Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment: 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? ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue4536> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com