t499.trans 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Module(body=[ClassDef(name='MyTest',
  2. bases=[],
  3. body=[FunctionDef(name='__init__',
  4. args=arguments(args=[Name(id='self',
  5. ctx=Param()),
  6. Name(id='s',
  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='w',
  14. ctx=Store())],
  15. value=Name(id='s',
  16. ctx=Load()))],
  17. decorator_list=[]),
  18. FunctionDef(name='length',
  19. args=arguments(args=[Name(id='self',
  20. ctx=Param())],
  21. vararg=None,
  22. kwarg=None,
  23. defaults=[]),
  24. body=[Return(value=Call(func=Name(id='len',
  25. ctx=Load()),
  26. args=[Attribute(value=Name(id='self',
  27. ctx=Load()),
  28. attr='w',
  29. ctx=Load())],
  30. keywords=[],
  31. starargs=None,
  32. kwargs=None))],
  33. decorator_list=[])],
  34. decorator_list=[]),
  35. Assign(targets=[Name(id='x',
  36. ctx=Store())],
  37. value=Call(func=Name(id='MyTest',
  38. ctx=Load()),
  39. args=[Str(s='foo')],
  40. keywords=[],
  41. starargs=None,
  42. kwargs=None)),
  43. Print(dest=None,
  44. values=[Call(func=Attribute(value=Name(id='x',
  45. ctx=Load()),
  46. attr='length',
  47. ctx=Load()),
  48. args=[],
  49. keywords=[],
  50. starargs=None,
  51. kwargs=None)],
  52. nl=True)])