t292.trans 4.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. Module(body=[FunctionDef(name='mygen',
  2. args=arguments(args=[Name(id='upto',
  3. ctx=Param())],
  4. vararg=None,
  5. kwarg=None,
  6. defaults=[]),
  7. body=[For(target=Name(id='i',
  8. ctx=Store()),
  9. iter=Call(func=Name(id='range',
  10. ctx=Load()),
  11. args=[Num(n=0),
  12. Name(id='upto',
  13. ctx=Load())],
  14. keywords=[],
  15. starargs=None,
  16. kwargs=None),
  17. body=[Print(dest=None,
  18. values=[Str(s='i'),
  19. Name(id='i',
  20. ctx=Load())],
  21. nl=True),
  22. Assign(targets=[Name(id='got',
  23. ctx=Store())],
  24. value=Yield(value=Name(id='i',
  25. ctx=Load()))),
  26. Print(dest=None,
  27. values=[Str(s='got'),
  28. Name(id='got',
  29. ctx=Load())],
  30. nl=True)],
  31. orelse=[])],
  32. decorator_list=[]),
  33. Assign(targets=[Name(id='handle',
  34. ctx=Store())],
  35. value=Call(func=Name(id='mygen',
  36. ctx=Load()),
  37. args=[Num(n=3)],
  38. keywords=[],
  39. starargs=None,
  40. kwargs=None)),
  41. Assign(targets=[Name(id='first',
  42. ctx=Store())],
  43. value=Name(id='True',
  44. ctx=Load())),
  45. For(target=Name(id='num',
  46. ctx=Store()),
  47. iter=Name(id='handle',
  48. ctx=Load()),
  49. body=[Print(dest=None,
  50. values=[Str(s='num'),
  51. Name(id='num',
  52. ctx=Load())],
  53. nl=True),
  54. If(test=Name(id='first',
  55. ctx=Load()),
  56. body=[Print(dest=None,
  57. values=[Str(s='signalling')],
  58. nl=True),
  59. Assign(targets=[Name(id='foo',
  60. ctx=Store())],
  61. value=Call(func=Attribute(value=Name(id='handle',
  62. ctx=Load()),
  63. attr='send',
  64. ctx=Load()),
  65. args=[Str(s='sig')],
  66. keywords=[],
  67. starargs=None,
  68. kwargs=None)),
  69. Print(dest=None,
  70. values=[Str(s='foo'),
  71. Name(id='foo',
  72. ctx=Load())],
  73. nl=True),
  74. Assign(targets=[Name(id='first',
  75. ctx=Store())],
  76. value=Name(id='False',
  77. ctx=Load()))],
  78. orelse=[])],
  79. orelse=[])])