Terry J. Reedy <tjre...@udel.edu> added the comment:

I would like python_coded_callable.__code__ to be the code object executed when 
python_coded_callable is called, just as expected by the isxyz author(s).  It 
has to exist somewhere.  Methods m and m3 both return 42 when called, and both 
have the same code object.

>>> m3.__code__
<code object __call__ at 0x000001431C797E40, file "F:\Python\a\tem2.py", line 3>
>>> m3.__func__.__code__
<code object __call__ at 0x000001431C797E40, file "F:\Python\a\tem2.py", line 3>
>>> m.__func__.__call__.__code__
<code object __call__ at 0x000001431C797E40, file "F:\Python\a\tem2.py", line 3>

The fact that m requires an additional level of indirection is an 
implementation detail that I don't think necessarily has to involve users.

----------

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

Reply via email to