fork download
  1. class Thing:
  2. def __foo(self):
  3. print "foo()"
  4.  
  5. def __init__(self):
  6. self.__foo()
  7.  
  8. thing = Thing()
  9. thing.__foo()
Runtime error #stdin #stdout #stderr 0.01s 8968KB
stdin
Standard input is empty
stdout
foo()
stderr
Traceback (most recent call last):
  File "prog.py", line 9, in <module>
AttributeError: Thing instance has no attribute '__foo'