[issue15354] _PyObject_LengthHint only accepts longs

2012-07-14 Thread Roundup Robot
Roundup Robot added the comment: New changeset 872afada51b0 by Benjamin Peterson in branch '2.7': allow any number to be returned from __length_hint__ (closes #15354) http://hg.python.org/cpython/rev/872afada51b0 -- nosy: +python-dev resolution: -> fixed stage: -> committed/rejected s

[issue15354] _PyObject_LengthHint only accepts longs

2012-07-14 Thread Benjamin Peterson
Benjamin Peterson added the comment: It's probably easier just to use PyNumber_Check. -- nosy: +benjamin.peterson ___ Python tracker ___

[issue15354] _PyObject_LengthHint only accepts longs

2012-07-14 Thread Philip Jenvey
Philip Jenvey added the comment: attached a fix for review -- keywords: +patch Added file: http://bugs.python.org/file26383/lengthhint-fix.diff ___ Python tracker ___ __

[issue15354] _PyObject_LengthHint only accepts longs

2012-07-14 Thread Philip Jenvey
New submission from Philip Jenvey : The __length_hint__ optimization was broken a while ago for many iterators due to a bug introduced in 44c090c74202. It only accepts longs as valid hints, not ints This affects 2.6 too (but that's in security-only fix mode), but not 3.x -- assignee: