t555.trans 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. Module(body=[ImportFrom(module='time',
  2. names=[alias(name='sleep',
  3. asname=None)],
  4. level=0),
  5. FunctionDef(name='sleeping_generator',
  6. args=arguments(args=[],
  7. vararg=None,
  8. kwarg=None,
  9. defaults=[]),
  10. body=[For(target=Name(id='i',
  11. ctx=Store()),
  12. iter=Call(func=Name(id='range',
  13. ctx=Load()),
  14. args=[Num(n=5)],
  15. keywords=[],
  16. starargs=None,
  17. kwargs=None),
  18. body=[Expr(value=Call(func=Name(id='sleep',
  19. ctx=Load()),
  20. args=[Num(n=0.01)],
  21. keywords=[],
  22. starargs=None,
  23. kwargs=None)),
  24. Expr(value=Yield(value=Name(id='i',
  25. ctx=Load())))],
  26. orelse=[])],
  27. decorator_list=[]),
  28. Assign(targets=[Name(id='x',
  29. ctx=Store())],
  30. value=GeneratorExp(elt=Name(id='i',
  31. ctx=Load()),
  32. generators=[comprehension(target=Name(id='i',
  33. ctx=Store()),
  34. iter=Call(func=Name(id='sleeping_generator',
  35. ctx=Load()),
  36. args=[],
  37. keywords=[],
  38. starargs=None,
  39. kwargs=None),
  40. ifs=[])])),
  41. Print(dest=None,
  42. values=[Call(func=Name(id='list',
  43. ctx=Load()),
  44. args=[Name(id='x',
  45. ctx=Load())],
  46. keywords=[],
  47. starargs=None,
  48. kwargs=None)],
  49. nl=True)])