[issue11674] list(obj), tuple(obj) swallow TypeError (in _PyObject_LengthHint)

Amaury Forgeot d'Arc report at bugs.python.org
Fri Mar 25 21:56:27 CET 2011


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

_PyObject_LengthHint() does not define any exception; it simply calls PyObject_Size(), which is expected to raise TypeError for objects with no size (an opened file for example).

Where is the problem exacty? Does the failing __len__ put the object in an invalid state?

----------
nosy: +amaury.forgeotdarc

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


More information about the Python-bugs-list mailing list