t323.trans 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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='arg',
  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='x',
  14. ctx=Store())],
  15. value=Name(id='None',
  16. ctx=Load()))],
  17. decorator_list=[]),
  18. FunctionDef(name='__getitem__',
  19. args=arguments(args=[Name(id='self',
  20. ctx=Param()),
  21. Name(id='key',
  22. ctx=Param())],
  23. vararg=None,
  24. kwarg=None,
  25. defaults=[]),
  26. body=[Return(value=Attribute(value=Name(id='self',
  27. ctx=Load()),
  28. attr='x',
  29. ctx=Load()))],
  30. decorator_list=[])],
  31. decorator_list=[]),
  32. Assign(targets=[Name(id='x',
  33. ctx=Store())],
  34. value=Call(func=Name(id='Foo',
  35. ctx=Load()),
  36. args=[Num(n=5)],
  37. keywords=[],
  38. starargs=None,
  39. kwargs=None)),
  40. Print(dest=None,
  41. values=[Subscript(value=Name(id='x',
  42. ctx=Load()),
  43. slice=Index(value=Num(n=1)),
  44. ctx=Load())],
  45. nl=True)])