t209.trans 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. Module(body=[ClassDef(name='X',
  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='px',
  12. ctx=Store())],
  13. value=Num(n=3))],
  14. decorator_list=[]),
  15. FunctionDef(name='y',
  16. args=arguments(args=[Name(id='self',
  17. ctx=Param())],
  18. vararg=None,
  19. kwarg=None,
  20. defaults=[]),
  21. body=[Assign(targets=[Name(id='l',
  22. ctx=Store())],
  23. value=Str(s='xyz')),
  24. If(test=Compare(left=Call(func=Name(id='len',
  25. ctx=Load()),
  26. args=[Name(id='l',
  27. ctx=Load())],
  28. keywords=[],
  29. starargs=None,
  30. kwargs=None),
  31. ops=[Eq()],
  32. comparators=[Attribute(value=Name(id='self',
  33. ctx=Load()),
  34. attr='px',
  35. ctx=Load())]),
  36. body=[Print(dest=None,
  37. values=[Str(s='OK')],
  38. nl=True)],
  39. orelse=[])],
  40. decorator_list=[])],
  41. decorator_list=[]),
  42. Assign(targets=[Name(id='x',
  43. ctx=Store())],
  44. value=Call(func=Name(id='X',
  45. ctx=Load()),
  46. args=[],
  47. keywords=[],
  48. starargs=None,
  49. kwargs=None)),
  50. Expr(value=Call(func=Attribute(value=Name(id='x',
  51. ctx=Load()),
  52. attr='y',
  53. ctx=Load()),
  54. args=[],
  55. keywords=[],
  56. starargs=None,
  57. kwargs=None))])