t317.trans 5.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. Module(body=[ClassDef(name='Point',
  2. bases=[],
  3. body=[FunctionDef(name='__init__',
  4. args=arguments(args=[Name(id='self',
  5. ctx=Param()),
  6. Name(id='initX',
  7. ctx=Param()),
  8. Name(id='initY',
  9. ctx=Param())],
  10. vararg=None,
  11. kwarg=None,
  12. defaults=[]),
  13. body=[Assign(targets=[Attribute(value=Name(id='self',
  14. ctx=Load()),
  15. attr='x',
  16. ctx=Store())],
  17. value=Name(id='initX',
  18. ctx=Load())),
  19. Assign(targets=[Attribute(value=Name(id='self',
  20. ctx=Load()),
  21. attr='y',
  22. ctx=Store())],
  23. value=Name(id='initY',
  24. ctx=Load()))],
  25. decorator_list=[]),
  26. FunctionDef(name='__str__',
  27. args=arguments(args=[Name(id='self',
  28. ctx=Param())],
  29. vararg=None,
  30. kwarg=None,
  31. defaults=[]),
  32. body=[Return(value=BinOp(left=BinOp(left=Call(func=Name(id='str',
  33. ctx=Load()),
  34. args=[Attribute(value=Name(id='self',
  35. ctx=Load()),
  36. attr='x',
  37. ctx=Load())],
  38. keywords=[],
  39. starargs=None,
  40. kwargs=None),
  41. op=Add(),
  42. right=Str(s=',')),
  43. op=Add(),
  44. right=Call(func=Name(id='str',
  45. ctx=Load()),
  46. args=[Attribute(value=Name(id='self',
  47. ctx=Load()),
  48. attr='y',
  49. ctx=Load())],
  50. keywords=[],
  51. starargs=None,
  52. kwargs=None)))],
  53. decorator_list=[])],
  54. decorator_list=[]),
  55. Assign(targets=[Name(id='p',
  56. ctx=Store())],
  57. value=Call(func=Name(id='Point',
  58. ctx=Load()),
  59. args=[Num(n=1),
  60. Num(n=2)],
  61. keywords=[],
  62. starargs=None,
  63. kwargs=None)),
  64. Print(dest=None,
  65. values=[Name(id='p',
  66. ctx=Load())],
  67. nl=True),
  68. Print(dest=None,
  69. values=[Call(func=Name(id='str',
  70. ctx=Load()),
  71. args=[Name(id='p',
  72. ctx=Load())],
  73. keywords=[],
  74. starargs=None,
  75. kwargs=None)],
  76. nl=True)])