t502.trans 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. Module(body=[ClassDef(name='A',
  2. bases=[],
  3. body=[FunctionDef(name='__getitem__',
  4. args=arguments(args=[Name(id='self',
  5. ctx=Param()),
  6. Name(id='slices',
  7. ctx=Param())],
  8. vararg=None,
  9. kwarg=None,
  10. defaults=[]),
  11. body=[Return(value=Name(id='slices',
  12. ctx=Load()))],
  13. decorator_list=[])],
  14. decorator_list=[]),
  15. Assign(targets=[Name(id='a',
  16. ctx=Store())],
  17. value=Call(func=Name(id='A',
  18. ctx=Load()),
  19. args=[],
  20. keywords=[],
  21. starargs=None,
  22. kwargs=None)),
  23. Print(dest=None,
  24. values=[Subscript(value=Name(id='a',
  25. ctx=Load()),
  26. slice=Index(value=Num(n=1)),
  27. ctx=Load())],
  28. nl=True),
  29. Print(dest=None,
  30. values=[Subscript(value=Name(id='a',
  31. ctx=Load()),
  32. slice=Slice(lower=Num(n=0),
  33. upper=Num(n=2),
  34. step=None),
  35. ctx=Load())],
  36. nl=True),
  37. Print(dest=None,
  38. values=[Subscript(value=Name(id='a',
  39. ctx=Load()),
  40. slice=Slice(lower=None,
  41. upper=Num(n=2),
  42. step=None),
  43. ctx=Load())],
  44. nl=True),
  45. Print(dest=None,
  46. values=[Call(func=Name(id='slice',
  47. ctx=Load()),
  48. args=[Num(n=2)],
  49. keywords=[],
  50. starargs=None,
  51. kwargs=None)],
  52. nl=True),
  53. Print(dest=None,
  54. values=[Subscript(value=Name(id='a',
  55. ctx=Load()),
  56. slice=Slice(lower=Num(n=1),
  57. upper=None,
  58. step=None),
  59. ctx=Load())],
  60. nl=True),
  61. Print(dest=None,
  62. values=[Subscript(value=Name(id='a',
  63. ctx=Load()),
  64. slice=Slice(lower=None,
  65. upper=None,
  66. step=None),
  67. ctx=Load())],
  68. nl=True),
  69. Print(dest=None,
  70. values=[Subscript(value=Name(id='a',
  71. ctx=Load()),
  72. slice=Slice(lower=None,
  73. upper=None,
  74. step=Name(id='None',
  75. ctx=Load())),
  76. ctx=Load())],
  77. nl=True),
  78. Print(dest=None,
  79. values=[Subscript(value=Name(id='a',
  80. ctx=Load()),
  81. slice=Slice(lower=None,
  82. upper=None,
  83. step=Num(n=-1)),
  84. ctx=Load())],
  85. nl=True),
  86. Print(dest=None,
  87. values=[Subscript(value=Name(id='a',
  88. ctx=Load()),
  89. slice=ExtSlice(dims=[Index(value=Num(n=0)),
  90. Slice(lower=Num(n=1),
  91. upper=Num(n=2),
  92. step=None)]),
  93. ctx=Load())],
  94. nl=True),
  95. Print(dest=None,
  96. values=[Subscript(value=Name(id='a',
  97. ctx=Load()),
  98. slice=ExtSlice(dims=[Slice(lower=Num(n=0),
  99. upper=Num(n=2),
  100. step=None),
  101. Slice(lower=Num(n=2),
  102. upper=Num(n=30),
  103. step=Num(n=1))]),
  104. ctx=Load())],
  105. nl=True),
  106. Assert(test=Compare(left=Subscript(value=Name(id='a',
  107. ctx=Load()),
  108. slice=Index(value=Num(n=1)),
  109. ctx=Load()),
  110. ops=[Eq()],
  111. comparators=[Num(n=1)]),
  112. msg=None),
  113. Assert(test=Compare(left=Subscript(value=Name(id='a',
  114. ctx=Load()),
  115. slice=Slice(lower=Num(n=0),
  116. upper=Num(n=2),
  117. step=None),
  118. ctx=Load()),
  119. ops=[Eq()],
  120. comparators=[Call(func=Name(id='slice',
  121. ctx=Load()),
  122. args=[Num(n=0),
  123. Num(n=2)],
  124. keywords=[],
  125. starargs=None,
  126. kwargs=None)]),
  127. msg=None),
  128. Assert(test=Compare(left=Subscript(value=Name(id='a',
  129. ctx=Load()),
  130. slice=ExtSlice(dims=[Index(value=Num(n=0)),
  131. Slice(lower=Num(n=1),
  132. upper=Num(n=2),
  133. step=None)]),
  134. ctx=Load()),
  135. ops=[Eq()],
  136. comparators=[Tuple(elts=[Num(n=0),
  137. Call(func=Name(id='slice',
  138. ctx=Load()),
  139. args=[Num(n=1),
  140. Num(n=2)],
  141. keywords=[],
  142. starargs=None,
  143. kwargs=None)],
  144. ctx=Load())]),
  145. msg=None),
  146. Assert(test=Compare(left=Subscript(value=Name(id='a',
  147. ctx=Load()),
  148. slice=ExtSlice(dims=[Slice(lower=Num(n=0),
  149. upper=Num(n=2),
  150. step=None),
  151. Slice(lower=Num(n=2),
  152. upper=Num(n=30),
  153. step=Num(n=1))]),
  154. ctx=Load()),
  155. ops=[Eq()],
  156. comparators=[Tuple(elts=[Call(func=Name(id='slice',
  157. ctx=Load()),
  158. args=[Num(n=0),
  159. Num(n=2)],
  160. keywords=[],
  161. starargs=None,
  162. kwargs=None),
  163. Call(func=Name(id='slice',
  164. ctx=Load()),
  165. args=[Num(n=2),
  166. Num(n=30),
  167. Num(n=1)],
  168. keywords=[],
  169. starargs=None,
  170. kwargs=None)],
  171. ctx=Load())]),
  172. msg=None),
  173. Assert(test=Compare(left=Call(func=Name(id='slice',
  174. ctx=Load()),
  175. args=[Num(n=0),
  176. Num(n=2)],
  177. keywords=[],
  178. starargs=None,
  179. kwargs=None),
  180. ops=[Eq()],
  181. comparators=[Call(func=Name(id='slice',
  182. ctx=Load()),
  183. args=[Num(n=0),
  184. Num(n=2)],
  185. keywords=[],
  186. starargs=None,
  187. kwargs=None)]),
  188. msg=None),
  189. Assert(test=Compare(left=Call(func=Name(id='slice',
  190. ctx=Load()),
  191. args=[Num(n=0),
  192. Num(n=2)],
  193. keywords=[],
  194. starargs=None,
  195. kwargs=None),
  196. ops=[Lt()],
  197. comparators=[Call(func=Name(id='slice',
  198. ctx=Load()),
  199. args=[Num(n=1),
  200. Num(n=2)],
  201. keywords=[],
  202. starargs=None,
  203. kwargs=None)]),
  204. msg=None),
  205. Assert(test=Compare(left=Call(func=Name(id='slice',
  206. ctx=Load()),
  207. args=[Num(n=0),
  208. Num(n=2)],
  209. keywords=[],
  210. starargs=None,
  211. kwargs=None),
  212. ops=[Lt()],
  213. comparators=[Call(func=Name(id='slice',
  214. ctx=Load()),
  215. args=[Num(n=1),
  216. Num(n=1)],
  217. keywords=[],
  218. starargs=None,
  219. kwargs=None)]),
  220. msg=None),
  221. Assert(test=Compare(left=Call(func=Name(id='slice',
  222. ctx=Load()),
  223. args=[Num(n=2)],
  224. keywords=[],
  225. starargs=None,
  226. kwargs=None),
  227. ops=[Lt()],
  228. comparators=[Call(func=Name(id='slice',
  229. ctx=Load()),
  230. args=[Num(n=0),
  231. Num(n=2)],
  232. keywords=[],
  233. starargs=None,
  234. kwargs=None)]),
  235. msg=None),
  236. Assert(test=Compare(left=Call(func=Name(id='slice',
  237. ctx=Load()),
  238. args=[Num(n=1),
  239. Num(n=2)],
  240. keywords=[],
  241. starargs=None,
  242. kwargs=None),
  243. ops=[Lt()],
  244. comparators=[Call(func=Name(id='slice',
  245. ctx=Load()),
  246. args=[Num(n=1),
  247. Num(n=2),
  248. Num(n=3)],
  249. keywords=[],
  250. starargs=None,
  251. kwargs=None)]),
  252. msg=None),
  253. Assert(test=Compare(left=Call(func=Name(id='slice',
  254. ctx=Load()),
  255. args=[Num(n=1),
  256. Num(n=2),
  257. Num(n=3)],
  258. keywords=[],
  259. starargs=None,
  260. kwargs=None),
  261. ops=[Lt()],
  262. comparators=[Call(func=Name(id='slice',
  263. ctx=Load()),
  264. args=[Num(n=1),
  265. Num(n=2),
  266. Num(n=4)],
  267. keywords=[],
  268. starargs=None,
  269. kwargs=None)]),
  270. msg=None),
  271. Assert(test=Compare(left=Call(func=Name(id='slice',
  272. ctx=Load()),
  273. args=[Num(n=1),
  274. Num(n=-1)],
  275. keywords=[],
  276. starargs=None,
  277. kwargs=None),
  278. ops=[Lt()],
  279. comparators=[Call(func=Name(id='slice',
  280. ctx=Load()),
  281. args=[Num(n=1),
  282. Num(n=1)],
  283. keywords=[],
  284. starargs=None,
  285. kwargs=None)]),
  286. msg=None),
  287. Assert(test=Compare(left=Call(func=Name(id='slice',
  288. ctx=Load()),
  289. args=[Num(n=0),
  290. Num(n=1)],
  291. keywords=[],
  292. starargs=None,
  293. kwargs=None),
  294. ops=[Lt()],
  295. comparators=[Call(func=Name(id='slice',
  296. ctx=Load()),
  297. args=[Num(n=1),
  298. Num(n=-1)],
  299. keywords=[],
  300. starargs=None,
  301. kwargs=None)]),
  302. msg=None),
  303. Assert(test=Compare(left=Subscript(value=Name(id='a',
  304. ctx=Load()),
  305. slice=Index(value=Str(s='foo')),
  306. ctx=Load()),
  307. ops=[Eq()],
  308. comparators=[Str(s='foo')]),
  309. msg=None),
  310. Assert(test=Compare(left=Attribute(value=Subscript(value=Name(id='a',
  311. ctx=Load()),
  312. slice=Slice(lower=Str(s='foo'),
  313. upper=Tuple(elts=[Num(n=1),
  314. Num(n=2)],
  315. ctx=Load()),
  316. step=Name(id='True',
  317. ctx=Load())),
  318. ctx=Load()),
  319. attr='start',
  320. ctx=Load()),
  321. ops=[Eq()],
  322. comparators=[Str(s='foo')]),
  323. msg=None),
  324. Assert(test=Compare(left=Attribute(value=Subscript(value=Name(id='a',
  325. ctx=Load()),
  326. slice=Slice(lower=Str(s='foo'),
  327. upper=Tuple(elts=[Num(n=1),
  328. Num(n=2)],
  329. ctx=Load()),
  330. step=Name(id='True',
  331. ctx=Load())),
  332. ctx=Load()),
  333. attr='stop',
  334. ctx=Load()),
  335. ops=[Eq()],
  336. comparators=[Tuple(elts=[Num(n=1),
  337. Num(n=2)],
  338. ctx=Load())]),
  339. msg=None),
  340. Assert(test=Compare(left=Attribute(value=Subscript(value=Name(id='a',
  341. ctx=Load()),
  342. slice=Slice(lower=Str(s='foo'),
  343. upper=Tuple(elts=[Num(n=1),
  344. Num(n=2)],
  345. ctx=Load()),
  346. step=Name(id='True',
  347. ctx=Load())),
  348. ctx=Load()),
  349. attr='step',
  350. ctx=Load()),
  351. ops=[Eq()],
  352. comparators=[Name(id='True',
  353. ctx=Load())]),
  354. msg=None)])