-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathbugs.json
More file actions
50 lines (50 loc) · 2.55 KB
/
Copy pathbugs.json
File metadata and controls
50 lines (50 loc) · 2.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
{
"_meta": {
"source": "MicroPython tests/basics differential vs CPython 3.13",
"verified": "each repro re-run through VM + python3",
"count": 5,
"fixed": "95 bugs fixed in vm.json: try/finally unwinding, yield-from expressions, range overflow/truncation/contains, in-place set ops, del of closures, lt sorting, nested next() corruption."
},
"bugs": [
{
"id": "assign_expr",
"category": "control-flow",
"summary": "any() does not short-circuit, so a walrus var assigned inside the generator keeps the last-iteration value instead of stopping at the matching element.",
"repro": "def foo():\n any((hit := i) == 8 for i in range(20))\n return hit\nprint(foo())",
"expected": "8",
"actual": "19"
},
{
"id": "gen_yield_from_executing",
"category": "scoping",
"summary": "A generator that yields from itself via a module-global name raises NameError on that validly-bound name instead of the expected ValueError; the global binding is lost on generator re-entry.",
"repro": "def f():\n yield 1\n yield from g\ng = f()\nprint(next(g))\ntry:\n next(g)\nexcept ValueError:\n print('ValueError')",
"expected": "1\nValueError",
"actual": "1"
},
{
"id": "scope_implicit",
"category": "scoping",
"summary": "Implicit nonlocal closure over a variable defined in the enclosing scope after the nested function raises NameError instead of capturing it.",
"repro": "def f():\n def g():\n return x\n x = 3\n return g\nprint(f()())",
"expected": "3",
"actual": "__VMERR__ NameError: name 'x' is not defined"
},
{
"id": "generator_closure",
"category": "stack-underflow",
"summary": "A generator expression nested inside another generator expression triggers an internal stack underflow on valid supported syntax.",
"repro": "gg = ((x for x in range(2)) for y in range(2))\nfor i in gg:\n for j in i:\n print(j)",
"expected": "0\n1\n0\n1",
"actual": "__VMERR__ RuntimeError: stack underflow"
},
{
"id": "fun_kwvarargs",
"category": "wrong-value",
"summary": "A call mixing a starred argument that is itself a function call with a keyword argument whose value is also a function call corrupts argument evaluation and raises TypeError: object is not callable.",
"repro": "def f(*a, **k):\n print(a, k)\ndef g(x):\n return x\nf(*g([1, 2]), z=g(3))",
"expected": "(1, 2) {'z': 3}",
"actual": "__VMERR__ TypeError: object is not callable"
}
]
}