t185.trans 4.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. Module(body=[ClassDef(name='Wee',
  2. bases=[],
  3. body=[FunctionDef(name='__init__',
  4. args=arguments(args=[Name(id='self',
  5. ctx=Param())],
  6. vararg=None,
  7. kwarg=None,
  8. defaults=[]),
  9. body=[Assign(targets=[Attribute(value=Name(id='self',
  10. ctx=Load()),
  11. attr='called',
  12. ctx=Store())],
  13. value=Name(id='False',
  14. ctx=Load()))],
  15. decorator_list=[]),
  16. FunctionDef(name='__iter__',
  17. args=arguments(args=[Name(id='self',
  18. ctx=Param())],
  19. vararg=None,
  20. kwarg=None,
  21. defaults=[]),
  22. body=[Return(value=Name(id='self',
  23. ctx=Load()))],
  24. decorator_list=[]),
  25. FunctionDef(name='next',
  26. args=arguments(args=[Name(id='self',
  27. ctx=Param())],
  28. vararg=None,
  29. kwarg=None,
  30. defaults=[]),
  31. body=[Print(dest=None,
  32. values=[Str(s='in next')],
  33. nl=True),
  34. If(test=UnaryOp(op=Not(),
  35. operand=Attribute(value=Name(id='self',
  36. ctx=Load()),
  37. attr='called',
  38. ctx=Load())),
  39. body=[Assign(targets=[Attribute(value=Name(id='self',
  40. ctx=Load()),
  41. attr='called',
  42. ctx=Store())],
  43. value=Name(id='True',
  44. ctx=Load())),
  45. Return(value=Str(s='dog'))],
  46. orelse=[]),
  47. Raise(type=Name(id='StopIteration',
  48. ctx=Load()),
  49. inst=None,
  50. tback=None)],
  51. decorator_list=[])],
  52. decorator_list=[]),
  53. For(target=Name(id='i',
  54. ctx=Store()),
  55. iter=Call(func=Name(id='Wee',
  56. ctx=Load()),
  57. args=[],
  58. keywords=[],
  59. starargs=None,
  60. kwargs=None),
  61. body=[Print(dest=None,
  62. values=[Name(id='i',
  63. ctx=Load())],
  64. nl=True)],
  65. orelse=[])])