t376.trans 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. Module(body=[ClassDef(name='HasLen',
  2. bases=[],
  3. body=[FunctionDef(name='__init__',
  4. args=arguments(args=[Name(id='self',
  5. ctx=Param()),
  6. Name(id='l',
  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='l',
  14. ctx=Store())],
  15. value=Name(id='l',
  16. ctx=Load()))],
  17. decorator_list=[]),
  18. FunctionDef(name='__len__',
  19. args=arguments(args=[Name(id='self',
  20. ctx=Param())],
  21. vararg=None,
  22. kwarg=None,
  23. defaults=[]),
  24. body=[Return(value=Attribute(value=Name(id='self',
  25. ctx=Load()),
  26. attr='l',
  27. ctx=Load()))],
  28. decorator_list=[])],
  29. decorator_list=[]),
  30. ClassDef(name='SubLen',
  31. bases=[Name(id='HasLen',
  32. ctx=Load())],
  33. body=[FunctionDef(name='__init__',
  34. args=arguments(args=[Name(id='self',
  35. ctx=Param()),
  36. Name(id='l',
  37. ctx=Param())],
  38. vararg=None,
  39. kwarg=None,
  40. defaults=[]),
  41. body=[Expr(value=Call(func=Attribute(value=Name(id='HasLen',
  42. ctx=Load()),
  43. attr='__init__',
  44. ctx=Load()),
  45. args=[Name(id='self',
  46. ctx=Load()),
  47. Name(id='l',
  48. ctx=Load())],
  49. keywords=[],
  50. starargs=None,
  51. kwargs=None))],
  52. decorator_list=[])],
  53. decorator_list=[]),
  54. ClassDef(name='NoLen',
  55. bases=[],
  56. body=[FunctionDef(name='__init__',
  57. args=arguments(args=[Name(id='self',
  58. ctx=Param()),
  59. Name(id='l',
  60. ctx=Param())],
  61. vararg=None,
  62. kwarg=None,
  63. defaults=[]),
  64. body=[Assign(targets=[Attribute(value=Name(id='self',
  65. ctx=Load()),
  66. attr='l',
  67. ctx=Store())],
  68. value=Name(id='l',
  69. ctx=Load()))],
  70. decorator_list=[])],
  71. decorator_list=[]),
  72. Assign(targets=[Name(id='h',
  73. ctx=Store())],
  74. value=Call(func=Name(id='HasLen',
  75. ctx=Load()),
  76. args=[Num(n=42)],
  77. keywords=[],
  78. starargs=None,
  79. kwargs=None)),
  80. Print(dest=None,
  81. values=[Call(func=Name(id='len',
  82. ctx=Load()),
  83. args=[Name(id='h',
  84. ctx=Load())],
  85. keywords=[],
  86. starargs=None,
  87. kwargs=None)],
  88. nl=True),
  89. Assign(targets=[Name(id='h2',
  90. ctx=Store())],
  91. value=Call(func=Name(id='SubLen',
  92. ctx=Load()),
  93. args=[Num(n=43)],
  94. keywords=[],
  95. starargs=None,
  96. kwargs=None)),
  97. Print(dest=None,
  98. values=[Call(func=Name(id='len',
  99. ctx=Load()),
  100. args=[Name(id='h2',
  101. ctx=Load())],
  102. keywords=[],
  103. starargs=None,
  104. kwargs=None)],
  105. nl=True),
  106. Assign(targets=[Name(id='h3',
  107. ctx=Store())],
  108. value=Call(func=Name(id='NoLen',
  109. ctx=Load()),
  110. args=[Num(n=44)],
  111. keywords=[],
  112. starargs=None,
  113. kwargs=None)),
  114. Print(dest=None,
  115. values=[Call(func=Name(id='len',
  116. ctx=Load()),
  117. args=[Name(id='h3',
  118. ctx=Load())],
  119. keywords=[],
  120. starargs=None,
  121. kwargs=None)],
  122. nl=True)])