Serhiy Storchaka <[email protected]> added the comment:
This is because the first line of the function definition was the line of the
last decorator in 3.7, and it is the line of the first decorator in 3.8.
$ rlwrap ./python -m dis
@decorator
@decorator
@decorator
def func():
pass
In 3.7:
2 0 LOAD_NAME 0 (decorator)
3 2 LOAD_NAME 0 (decorator)
4 4 LOAD_NAME 0 (decorator)
6 LOAD_CONST 0 (<code object func at
0x7f53a8281c40, file "<stdin>", line 2>)
8 LOAD_CONST 1 ('func')
10 MAKE_FUNCTION 0
12 CALL_FUNCTION 1
14 CALL_FUNCTION 1
16 CALL_FUNCTION 1
18 STORE_NAME 1 (func)
20 LOAD_CONST 2 (None)
22 RETURN_VALUE
In 3.8:
2 0 LOAD_NAME 0 (decorator)
3 2 LOAD_NAME 0 (decorator)
4 4 LOAD_NAME 0 (decorator)
2 6 LOAD_CONST 0 (<code object func at
0x7f7045a80100, file "<stdin>", line 2>)
8 LOAD_CONST 1 ('func')
10 MAKE_FUNCTION 0
12 CALL_FUNCTION 1
14 CALL_FUNCTION 1
16 CALL_FUNCTION 1
18 STORE_NAME 1 (func)
20 LOAD_CONST 2 (None)
22 RETURN_VALUE
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue34876>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com