t468.trans 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. Module(body=[ClassDef(name='Matrix',
  2. bases=[Name(id='object',
  3. ctx=Load())],
  4. body=[Expr(value=Str(s='\n Represents a matrix\n ')),
  5. FunctionDef(name='__init__',
  6. args=arguments(args=[Name(id='self',
  7. ctx=Param()),
  8. Name(id='matrix',
  9. ctx=Param())],
  10. vararg=None,
  11. kwarg=None,
  12. defaults=[Name(id='None',
  13. ctx=Load())]),
  14. body=[Expr(value=Str(s='\n ')),
  15. Assign(targets=[Attribute(value=Name(id='self',
  16. ctx=Load()),
  17. attr='mat',
  18. ctx=Store())],
  19. value=Name(id='matrix',
  20. ctx=Load()))],
  21. decorator_list=[]),
  22. FunctionDef(name='__getitem__',
  23. args=arguments(args=[Name(id='self',
  24. ctx=Param()),
  25. Name(id='index',
  26. ctx=Param())],
  27. vararg=None,
  28. kwarg=None,
  29. defaults=[]),
  30. body=[Expr(value=Str(s='\n ')),
  31. Return(value=Subscript(value=Subscript(value=Attribute(value=Name(id='self',
  32. ctx=Load()),
  33. attr='mat',
  34. ctx=Load()),
  35. slice=Index(value=Subscript(value=Name(id='index',
  36. ctx=Load()),
  37. slice=Index(value=Num(n=0)),
  38. ctx=Load())),
  39. ctx=Load()),
  40. slice=Index(value=Subscript(value=Name(id='index',
  41. ctx=Load()),
  42. slice=Index(value=Num(n=1)),
  43. ctx=Load())),
  44. ctx=Load()))],
  45. decorator_list=[]),
  46. FunctionDef(name='__setitem__',
  47. args=arguments(args=[Name(id='self',
  48. ctx=Param()),
  49. Name(id='index',
  50. ctx=Param()),
  51. Name(id='item',
  52. ctx=Param())],
  53. vararg=None,
  54. kwarg=None,
  55. defaults=[]),
  56. body=[Expr(value=Str(s='\n ')),
  57. Assign(targets=[Subscript(value=Subscript(value=Attribute(value=Name(id='self',
  58. ctx=Load()),
  59. attr='mat',
  60. ctx=Load()),
  61. slice=Index(value=Subscript(value=Name(id='index',
  62. ctx=Load()),
  63. slice=Index(value=Num(n=0)),
  64. ctx=Load())),
  65. ctx=Load()),
  66. slice=Index(value=Subscript(value=Name(id='index',
  67. ctx=Load()),
  68. slice=Index(value=Num(n=1)),
  69. ctx=Load())),
  70. ctx=Store())],
  71. value=Name(id='item',
  72. ctx=Load()))],
  73. decorator_list=[])],
  74. decorator_list=[]),
  75. Assign(targets=[Name(id='trial',
  76. ctx=Store())],
  77. value=Call(func=Name(id='Matrix',
  78. ctx=Load()),
  79. args=[List(elts=[List(elts=[Num(n=543)],
  80. ctx=Load())],
  81. ctx=Load())],
  82. keywords=[],
  83. starargs=None,
  84. kwargs=None)),
  85. Assign(targets=[Subscript(value=Name(id='trial',
  86. ctx=Load()),
  87. slice=Index(value=Tuple(elts=[Num(n=0),
  88. Num(n=0)],
  89. ctx=Load())),
  90. ctx=Store())],
  91. value=Num(n=100)),
  92. Print(dest=None,
  93. values=[Subscript(value=Name(id='trial',
  94. ctx=Load()),
  95. slice=Index(value=Tuple(elts=[Num(n=0),
  96. Num(n=0)],
  97. ctx=Load())),
  98. ctx=Load())],
  99. nl=True)])