Skip to content

Instantly share code, notes, and snippets.

@snim2
Created September 30, 2010 16:11
Show Gist options
  • Select an option

  • Save snim2/604842 to your computer and use it in GitHub Desktop.

Select an option

Save snim2/604842 to your computer and use it in GitHub Desktop.
>>> class Foo:
...
...
File "<stdin>", line 3
^
IndentationError: expected an indented block
>>> class Foo:
... def __init__(self):
... return
...
>>> class Bar(object):
... def __init__(self):
... return
...
>>> dir(Foo)
['__doc__', '__init__', '__module__']
>>> dir(Bar)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
>>> f, b = Foo(), Bar()
>>> dir(f)
['__doc__', '__init__', '__module__']
>>> dir(b)
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__']
>>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment