t355.trans 5.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. Module(body=[ClassDef(name='Foo',
  2. bases=[],
  3. body=[FunctionDef(name='__init__',
  4. args=arguments(args=[Name(id='self',
  5. ctx=Param()),
  6. Name(id='x',
  7. ctx=Param())],
  8. vararg=None,
  9. kwarg=None,
  10. defaults=[]),
  11. body=[Assign(targets=[Attribute(value=Name(id='self',
  12. ctx=Load()),
  13. attr='lst',
  14. ctx=Store())],
  15. value=List(elts=[Name(id='x',
  16. ctx=Load())],
  17. ctx=Load()))],
  18. decorator_list=[]),
  19. FunctionDef(name='__eq__',
  20. args=arguments(args=[Name(id='self',
  21. ctx=Param()),
  22. Name(id='other',
  23. ctx=Param())],
  24. vararg=None,
  25. kwarg=None,
  26. defaults=[]),
  27. body=[Return(value=Compare(left=Attribute(value=Name(id='self',
  28. ctx=Load()),
  29. attr='lst',
  30. ctx=Load()),
  31. ops=[Eq()],
  32. comparators=[Attribute(value=Name(id='other',
  33. ctx=Load()),
  34. attr='lst',
  35. ctx=Load())]))],
  36. decorator_list=[])],
  37. decorator_list=[]),
  38. Assign(targets=[Name(id='f1',
  39. ctx=Store())],
  40. value=Call(func=Name(id='Foo',
  41. ctx=Load()),
  42. args=[Num(n=3)],
  43. keywords=[],
  44. starargs=None,
  45. kwargs=None)),
  46. Assign(targets=[Name(id='f2',
  47. ctx=Store())],
  48. value=Call(func=Name(id='Foo',
  49. ctx=Load()),
  50. args=[Num(n=3)],
  51. keywords=[],
  52. starargs=None,
  53. kwargs=None)),
  54. Assign(targets=[Name(id='f3',
  55. ctx=Store())],
  56. value=Call(func=Name(id='Foo',
  57. ctx=Load()),
  58. args=[Num(n=4)],
  59. keywords=[],
  60. starargs=None,
  61. kwargs=None)),
  62. Print(dest=None,
  63. values=[Compare(left=Name(id='f1',
  64. ctx=Load()),
  65. ops=[Eq()],
  66. comparators=[Name(id='f1',
  67. ctx=Load())])],
  68. nl=True),
  69. Print(dest=None,
  70. values=[Compare(left=Name(id='f1',
  71. ctx=Load()),
  72. ops=[Eq()],
  73. comparators=[Name(id='f2',
  74. ctx=Load())])],
  75. nl=True),
  76. Print(dest=None,
  77. values=[Compare(left=Name(id='f1',
  78. ctx=Load()),
  79. ops=[NotEq()],
  80. comparators=[Name(id='f3',
  81. ctx=Load())])],
  82. nl=True),
  83. Print(dest=None,
  84. values=[Compare(left=Name(id='f1',
  85. ctx=Load()),
  86. ops=[NotEq()],
  87. comparators=[Name(id='f2',
  88. ctx=Load())])],
  89. nl=True)])