12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- Module(body=[ClassDef(name='GeneratorClass',
- bases=[],
- body=[Assign(targets=[Name(id='test',
- ctx=Store())],
- value=Str(s='hi')),
- FunctionDef(name='__init__',
- args=arguments(args=[Name(id='self',
- ctx=Param())],
- vararg=None,
- kwarg=None,
- defaults=[]),
- body=[Pass()],
- decorator_list=[]),
- FunctionDef(name='generator',
- args=arguments(args=[Name(id='self',
- ctx=Param())],
- vararg=None,
- kwarg=None,
- defaults=[]),
- body=[Print(dest=None,
- values=[Attribute(value=Name(id='self',
- ctx=Load()),
- attr='test',
- ctx=Load())],
- nl=True),
- For(target=Name(id='i',
- ctx=Store()),
- iter=Call(func=Name(id='range',
- ctx=Load()),
- args=[Num(n=10)],
- keywords=[],
- starargs=None,
- kwargs=None),
- body=[Expr(value=Yield(value=Name(id='i',
- ctx=Load())))],
- orelse=[])],
- decorator_list=[])],
- decorator_list=[]),
- Assign(targets=[Name(id='gen',
- ctx=Store())],
- value=Call(func=Name(id='GeneratorClass',
- ctx=Load()),
- args=[],
- keywords=[],
- starargs=None,
- kwargs=None)),
- For(target=Name(id='g',
- ctx=Store()),
- iter=Call(func=Attribute(value=Name(id='gen',
- ctx=Load()),
- attr='generator',
- ctx=Load()),
- args=[],
- keywords=[],
- starargs=None,
- kwargs=None),
- body=[Print(dest=None,
- values=[Name(id='g',
- ctx=Load())],
- nl=True)],
- orelse=[])])
|