This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, laszlo
Date 2008-12-04.23:58:11
SpamBayes Score 0.00017767504
Marked as misclassified No
Message-id <1228435093.07.0.510644011671.issue4536@psf.upfronthosting.co.za>
In-reply-to
Content
The analysis is good, but there are two problems with your patch:

- it crashes in debug mode, because a Py_INCREF(step) is missing in 
validate_step() (A comment above says: "Always returns a new reference")
- it does not work with 

>>> class Index:
...  def __index__(self):
...     return 42
...
>>> list(range(0, 100, Index()))
TypeError: unsupported operand type(s) for //: 'int' and 'Index'

In short: PyNumber_Index is not an unnecessary call!
But this does not invalidate the other parts of the patch. Would you try again?
History
Date User Action Args
2008-12-04 23:58:13amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, laszlo
2008-12-04 23:58:13amaury.forgeotdarcsetmessageid: <1228435093.07.0.510644011671.issue4536@psf.upfronthosting.co.za>
2008-12-04 23:58:12amaury.forgeotdarclinkissue4536 messages
2008-12-04 23:58:11amaury.forgeotdarccreate