t503.trans 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. Module(body=[ClassDef(name='Comparable',
  2. bases=[],
  3. body=[FunctionDef(name='__init__',
  4. args=arguments(args=[Name(id='self',
  5. ctx=Param()),
  6. Name(id='value',
  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='value',
  14. ctx=Store())],
  15. value=Name(id='value',
  16. ctx=Load()))],
  17. decorator_list=[]),
  18. FunctionDef(name='__lt__',
  19. args=arguments(args=[Name(id='self',
  20. ctx=Param()),
  21. Name(id='other',
  22. ctx=Param())],
  23. vararg=None,
  24. kwarg=None,
  25. defaults=[]),
  26. body=[Return(value=Compare(left=Attribute(value=Name(id='self',
  27. ctx=Load()),
  28. attr='value',
  29. ctx=Load()),
  30. ops=[Lt()],
  31. comparators=[Attribute(value=Name(id='other',
  32. ctx=Load()),
  33. attr='value',
  34. ctx=Load())]))],
  35. decorator_list=[]),
  36. FunctionDef(name='__repr__',
  37. args=arguments(args=[Name(id='self',
  38. ctx=Param())],
  39. vararg=None,
  40. kwarg=None,
  41. defaults=[]),
  42. body=[Return(value=BinOp(left=Str(s='Value :'),
  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='value',
  49. ctx=Load())],
  50. keywords=[],
  51. starargs=None,
  52. kwargs=None)))],
  53. decorator_list=[])],
  54. decorator_list=[]),
  55. Assign(targets=[Name(id='lst',
  56. ctx=Store())],
  57. value=List(elts=[Num(n=5),
  58. Num(n=9),
  59. Num(n=2),
  60. Num(n=7)],
  61. ctx=Load())),
  62. Assign(targets=[Name(id='otherLst',
  63. ctx=Store())],
  64. value=ListComp(elt=Call(func=Name(id='Comparable',
  65. ctx=Load()),
  66. args=[Name(id='a',
  67. ctx=Load())],
  68. keywords=[],
  69. starargs=None,
  70. kwargs=None),
  71. generators=[comprehension(target=Name(id='a',
  72. ctx=Store()),
  73. iter=Name(id='lst',
  74. ctx=Load()),
  75. ifs=[])])),
  76. Print(dest=None,
  77. values=[Name(id='lst',
  78. ctx=Load())],
  79. nl=True),
  80. Print(dest=None,
  81. values=[Name(id='otherLst',
  82. ctx=Load())],
  83. nl=True),
  84. Print(dest=None,
  85. values=[Call(func=Name(id='min',
  86. ctx=Load()),
  87. args=[Name(id='lst',
  88. ctx=Load())],
  89. keywords=[],
  90. starargs=None,
  91. kwargs=None)],
  92. nl=True),
  93. Print(dest=None,
  94. values=[Call(func=Name(id='min',
  95. ctx=Load()),
  96. args=[Name(id='otherLst',
  97. ctx=Load())],
  98. keywords=[],
  99. starargs=None,
  100. kwargs=None)],
  101. nl=True)])