[issue3445] Ignore missing attributes in functools.update_wrapper

July Tikhonov report at bugs.python.org
Sun May 2 16:06:37 CEST 2010


July Tikhonov <july.tikh at gmail.com> added the comment:

Patch updated: bound and unbound methods, user-defined callable, partial object included in test.

By the way,

>>> [id(abs.__doc__) for i in range(5)]
[140714383081744, 140714383081744, 140714383081744, 140714383081744, 140714383081744]
>>> [id(s) for s in [abs.__doc__ for i in range(5)]]
[140714383084040, 140714383082976, 140714383083144, 140714383075904, 140714383081744]

How it can be explained? Built-in functions (and methods) _sometimes_ return a new instance of its '__doc__' (and '__name__'), and sometimes does not.
(I found this trying to include built-in method into the test.)

----------
nosy: +july
Added file: http://bugs.python.org/file17184/update_wrapper-ignore-missing-attributes.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3445>
_______________________________________


More information about the Python-bugs-list mailing list