t354.trans 5.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. Module(body=[ClassDef(name='A',
  2. bases=[],
  3. body=[Assign(targets=[Name(id='val1',
  4. ctx=Store())],
  5. value=Str(s='A')),
  6. FunctionDef(name='__init__',
  7. args=arguments(args=[Name(id='self',
  8. ctx=Param()),
  9. Name(id='v',
  10. ctx=Param())],
  11. vararg=None,
  12. kwarg=None,
  13. defaults=[]),
  14. body=[Assign(targets=[Attribute(value=Name(id='self',
  15. ctx=Load()),
  16. attr='val1',
  17. ctx=Store())],
  18. value=Name(id='v',
  19. ctx=Load()))],
  20. decorator_list=[]),
  21. FunctionDef(name='do',
  22. args=arguments(args=[Name(id='self',
  23. ctx=Param())],
  24. vararg=None,
  25. kwarg=None,
  26. defaults=[]),
  27. body=[Print(dest=None,
  28. values=[Attribute(value=Attribute(value=Name(id='self',
  29. ctx=Load()),
  30. attr='__class__',
  31. ctx=Load()),
  32. attr='val1',
  33. ctx=Load())],
  34. nl=True),
  35. Print(dest=None,
  36. values=[Attribute(value=Name(id='self',
  37. ctx=Load()),
  38. attr='val1',
  39. ctx=Load())],
  40. nl=True)],
  41. decorator_list=[]),
  42. FunctionDef(name='update',
  43. args=arguments(args=[Name(id='self',
  44. ctx=Param()),
  45. Name(id='newv',
  46. ctx=Param())],
  47. vararg=None,
  48. kwarg=None,
  49. defaults=[]),
  50. body=[Assign(targets=[Attribute(value=Name(id='self',
  51. ctx=Load()),
  52. attr='val1',
  53. ctx=Store())],
  54. value=Name(id='newv',
  55. ctx=Load()))],
  56. decorator_list=[])],
  57. decorator_list=[]),
  58. Print(dest=None,
  59. values=[Str(s='===A===')],
  60. nl=True),
  61. Assign(targets=[Name(id='a',
  62. ctx=Store())],
  63. value=Call(func=Name(id='A',
  64. ctx=Load()),
  65. args=[Str(s='sa')],
  66. keywords=[],
  67. starargs=None,
  68. kwargs=None)),
  69. Expr(value=Call(func=Attribute(value=Name(id='a',
  70. ctx=Load()),
  71. attr='do',
  72. ctx=Load()),
  73. args=[],
  74. keywords=[],
  75. starargs=None,
  76. kwargs=None)),
  77. Expr(value=Call(func=Attribute(value=Name(id='a',
  78. ctx=Load()),
  79. attr='update',
  80. ctx=Load()),
  81. args=[Str(s='sa-new')],
  82. keywords=[],
  83. starargs=None,
  84. kwargs=None)),
  85. Expr(value=Call(func=Attribute(value=Name(id='a',
  86. ctx=Load()),
  87. attr='do',
  88. ctx=Load()),
  89. args=[],
  90. keywords=[],
  91. starargs=None,
  92. kwargs=None))])