Anthony Sottile <[email protected]> added the comment:
Looks as though annotations are using `LOAD_NAME` when they should probably use
`LOAD_GLOBAL`?
```
$ diff -u <(python3.9 -m dis t2.py | sed
's/0x[a-f0-9]*/0xdeadbeef/g;s/t2\.py/FILENAME/g') <(python3.9 -m dis t3.py |
sed 's/0x[a-f0-9]*/0xdeadbeef/g;s/t3\.py/FILENAME/g')
--- /dev/fd/63 2020-01-04 16:34:27.372004436 -0800
+++ /dev/fd/62 2020-01-04 16:34:27.372004436 -0800
@@ -10,7 +10,7 @@
16 RETURN_VALUE
Disassembly of <code object f at 0xdeadbeef, file "FILENAME", line 1>:
- 2 0 LOAD_NAME 0 (int)
+ 2 0 LOAD_GLOBAL 0 (int)
2 LOAD_CONST 1 (('arg',))
4 BUILD_CONST_KEY_MAP 1
6 LOAD_CONST 2 (<code object g at 0xdeadbeef, file
"FILENAME", line 2>)
```
t3.py is the same as t2.py but without positional-only arguments
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue39215>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com