You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Scheduler holds parked coroutines (and their `WaitingForChildren` task lists) across `top_loop` resumes; mark them so the saved state isn't swept under us.
Copy file name to clipboardExpand all lines: compiler/tests/cases/vm.json
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1712,6 +1712,11 @@
1712
1712
{"src": "class S:\n def __init__(self, data):\n self.data = data\n def __getitem__(self, i):\n return self.data[i]\ns = S([10, 20, 30, 40, 50])\ntotal = 0\nfor i in range(5):\n total = total + s[i]\nprint(total)", "output": ["150"]},
1713
1713
{"src": "class V:\n def __init__(self, n):\n self.n = n\n def __add__(self, o):\n if isinstance(o, V):\n return V(self.n + o.n)\n return NotImplemented\n def __radd__(self, o):\n return V(o + self.n)\ntotal = V(0)\nfor i in range(5):\n total = total + V(i)\nprint(total.n)\nprint((10 + V(5)).n)", "output": ["10", "15"]},
1714
1714
{"src": "class A:\n def __eq__(self, o):\n return isinstance(o, A)\nclass B:\n def __eq__(self, o):\n return False\nhits = 0\nfor i in range(10):\n if A() == A(): hits = hits + 1\n if B() == A(): hits = hits + 100\nprint(hits)", "output": ["10"]},
1715
+
{"src": "class B:\n def __eq__(self, /):\n x = {i for i in range(9)}\n return True\nn = 0\nfor i in range(300):\n if str(i) == B():\n n = n + 1\nprint(n)", "output": ["300"]},
1716
+
{"src": "class B:\n def __eq__(self, /):\n x = {i for i in range(9)}\n return NotImplemented\nn = 0\nfor i in range(300):\n if str(i) == B():\n n = n + 1\nprint(n)", "output": ["0"]},
1717
+
{"src": "class B:\n def __eq__(self, /):\n x = {i for i in range(9)}\n return NotImplemented\nn = 0\nfor i in range(300):\n if (i,) == B():\n n = n + 1\nprint(n)", "output": ["0"]},
1718
+
{"src": "class B:\n def __eq__(self, /):\n junk = [j for j in range(20)]\n return True\nhits = 0\nfor i in range(300):\n if [i, i + 1] == B():\n hits = hits + 1\nprint(hits)", "output": ["300"]},
1719
+
{"src": "class B:\n def __lt__(self, /):\n x = {i for i in range(9)}\n return True\nn = 0\nfor i in range(300):\n if [i] > B():\n n = n + 1\nprint(n)", "output": ["300"]},
0 commit comments