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

Benjamin Peterson report at bugs.python.org
Sat Apr 2 01:10:21 CEST 2011


Benjamin Peterson <benjamin at python.org> added the comment:

2011/4/1 Raymond Hettinger <report at bugs.python.org>:
> [benjamin]
> The __length_hint__ protocol is a public API, so anyone can use it.  Also, the issue is a broader than __length_hint__, it is really distinguishing multiple possible meanings for a TypeError raised by a call to __len__.

What?? I certainly hope not. I thought it was supposed to be a performance hack.

----------

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


More information about the Python-bugs-list mailing list