STINNER Victor added the comment:
Thanks Serhiy, it works and I like the result :-)
>>> def f():
... def g():
... return 3
... return g
...
>>> import dis; dis.dis(f)
2 0 LOAD_CONST 1 (<code object g at 0x7f16ab2e2c40,
file "<stdin>", line 2>)
2 LOAD_CONST 2 ('f.<locals>.g')
4 MAKE_FUNCTION 0
6 STORE_FAST 0 (g)
4 8 LOAD_FAST 0 (g)
10 RETURN_VALUE
Disassembly of <code object g at 0x7f16ab2e2c40, file "<stdin>", line 2>:
3 0 LOAD_CONST 1 (3)
2 RETURN_VALUE
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue11822>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com