Raymond Hettinger added the comment:
[Emanuel Barry]
> In which circumstances does comparing two code objects
> (at function creation time, what's more) make any sense?
It makes closures efficient:
>>> def f(x):
def g(y):
return x + y
return g
>>> h = f(1)
>>> i = f(2)
>>> h.__code__ is i.__code__
True
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25843>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com