1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- Module(body=[ClassDef(name='Wee',
- bases=[],
- body=[FunctionDef(name='__init__',
- args=arguments(args=[Name(id='self',
- ctx=Param())],
- vararg=None,
- kwarg=None,
- defaults=[]),
- body=[Assign(targets=[Attribute(value=Name(id='self',
- ctx=Load()),
- attr='called',
- ctx=Store())],
- value=Name(id='False',
- ctx=Load()))],
- decorator_list=[]),
- FunctionDef(name='__iter__',
- args=arguments(args=[Name(id='self',
- ctx=Param())],
- vararg=None,
- kwarg=None,
- defaults=[]),
- body=[Return(value=Name(id='self',
- ctx=Load()))],
- decorator_list=[]),
- FunctionDef(name='next',
- args=arguments(args=[Name(id='self',
- ctx=Param())],
- vararg=None,
- kwarg=None,
- defaults=[]),
- body=[Print(dest=None,
- values=[Str(s='in next')],
- nl=True),
- If(test=UnaryOp(op=Not(),
- operand=Attribute(value=Name(id='self',
- ctx=Load()),
- attr='called',
- ctx=Load())),
- body=[Assign(targets=[Attribute(value=Name(id='self',
- ctx=Load()),
- attr='called',
- ctx=Store())],
- value=Name(id='True',
- ctx=Load())),
- Return(value=Str(s='dog'))],
- orelse=[]),
- Raise(type=Name(id='StopIteration',
- ctx=Load()),
- inst=None,
- tback=None)],
- decorator_list=[])],
- decorator_list=[]),
- For(target=Name(id='i',
- ctx=Store()),
- iter=Call(func=Name(id='Wee',
- ctx=Load()),
- args=[],
- keywords=[],
- starargs=None,
- kwargs=None),
- body=[Print(dest=None,
- values=[Name(id='i',
- ctx=Load())],
- nl=True)],
- orelse=[])])
|