Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

It makes sense. If write decorators as explicit function calls:

decorated = (
    deco1(
        deco2(
            original
        )
    )
)

The line number of decorator itself will be used for CALL_FUNCTION:

  2           0 LOAD_NAME                0 (deco1)

  3           2 LOAD_NAME                1 (deco2)

  4           4 LOAD_NAME                2 (original)

  3           6 CALL_FUNCTION            1

  2           8 CALL_FUNCTION            1

  1          10 STORE_NAME               3 (decorated)
             12 LOAD_CONST               0 (None)
             14 RETURN_VALUE

But I suppose this will add more headache for coverage.py.

----------
nosy: +nedbat

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37971>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to