[issue6305] islice doesn't accept large stop values

2014-06-22 Thread Martin v . Löwis
Martin v. Löwis added the comment: Well, as Alok has indicated that he can understand this not getting accepted, I'm now fine with that, too. Terry: Raymond had already adjusted the error message five years ago. So closing this as "won't fix". -- resolution: -> wont fix status: open

[issue6305] islice doesn't accept large stop values

2014-06-22 Thread Terry J. Reedy
Terry J. Reedy added the comment: All contributions are subject to final commit review. I looked at the patch and it is a *lot* of code for little benefit. I think the better solution would be an informative error message: "Currently, islice arguments must be less than {} on {}-bit systems".fo

[issue6305] islice doesn't accept large stop values

2014-06-22 Thread Alok Singhal
Alok Singhal added the comment: Hi Raymond, Martin, I won't feel bad about this patch not making it into the final Python distribution. I worked on this bug because it was the only "core C" bug at PyCon US sprints for CPython. I learned a bit more about CPython while working on it and I don

[issue6305] islice doesn't accept large stop values

2014-06-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Martin, "finding it sad" doesn't really help much here. We *can* put the patch in. Alok devoted a good chunk of time to creating the patch and I've already devoted a good chunk of time to reviewing it. However, in so doing I became concerned that it wasn

[issue6305] islice doesn't accept large stop values

2014-06-22 Thread Martin v . Löwis
Martin v. Löwis added the comment: I'd find it sad if we would, after 5 years of asking for contributions, and after somebody actually contributing, now declare that we really don't want a contribution. -- nosy: +loewis ___ Python tracker

[issue6305] islice doesn't accept large stop values

2014-06-22 Thread Raymond Hettinger
Raymond Hettinger added the comment: Alok, overall the patch looks pretty good and you've done great work on it. However, in working through its details, I find myself having major misgivings about doubling the size and complexity of the code for something that may not be ever benefit any real

[issue6305] islice doesn't accept large stop values

2014-05-11 Thread Alok Singhal
Alok Singhal added the comment: Yes, I signed it a few days ago. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue6305] islice doesn't accept large stop values

2014-05-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Alok, have you signed a contributor agreement? -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue6305] islice doesn't accept large stop values

2014-05-10 Thread Alok Singhal
Alok Singhal added the comment: Uploading another patch which is the same as the last patch but this one applies cleanly after the latest islice changes for #21321. -- Added file: http://bugs.python.org/file35205/islice_large_values-4.patch ___ Pytho

[issue6305] islice doesn't accept large stop values

2014-04-22 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https

[issue6305] islice doesn't accept large stop values

2014-04-22 Thread Alok Singhal
Alok Singhal added the comment: OK. Here is the first patch with a couple of bug fixes for "slow mode". -- Added file: http://bugs.python.org/file34999/islice_large_values-3.patch ___ Python tracker ___

[issue6305] islice doesn't accept large stop values

2014-04-21 Thread Raymond Hettinger
Raymond Hettinger added the comment: The first patch was cleaner. I don't think it is necessary to start-fast and switch-to-slow in the case where not all of the arguments are in the normal range. -- ___ Python tracker

[issue6305] islice doesn't accept large stop values

2014-04-21 Thread Alok Singhal
Alok Singhal added the comment: This updated patch has support for starting in fast mode until the next count would result in overflow in Py_ssize_t. The first patch started in slow mode as soon as any of 'start', 'stop', or 'step' was outside of the range. With this patch, we start in fast

[issue6305] islice doesn't accept large stop values

2014-04-18 Thread Alok Singhal
Alok Singhal added the comment: Here's a proposed patch. I need more tests for large values, but all the tests I could think of take a long time to get to a long value. I added some tests that don't take much time but work correctly for long values. If anyone has any ideas for some other te

[issue6305] islice doesn't accept large stop values

2014-04-16 Thread Alok Singhal
Alok Singhal added the comment: OK. I have written the "slow path" version and tested it a bit. I will add the code to switch between the paths and also add test cases as well. Thanks! -- ___ Python tracker

[issue6305] islice doesn't accept large stop values

2014-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Yes, you should add a fastpath and a slow path. Take a look at itertools.count() or builtins.enumerate() to see how to do it. This is a bit tricky to switch between modes, so you will need a thorough set of test cases. -- versions: +Python 3.5 -Py

[issue6305] islice doesn't accept large stop values

2014-04-16 Thread Alok Singhal
Alok Singhal added the comment: I started working on this bug as a part of PyCon US 2014 sprints. Should the bugfix include a fast path (basically the current implementation) for when the values involved can fit in an int, and a slow path for larger values? Or should the bugfix just have one

[issue6305] islice doesn't accept large stop values

2010-11-04 Thread Terry J. Reedy
Terry J. Reedy added the comment: In 3.1.2, range handles large numbers. >>> list(range(10, 500, 100)) [10, 110, 210, 310, 410] # those are all billions This means that the 'equivalent' code in the doc will work. -- nosy:

[issue6305] islice doesn't accept large stop values

2010-09-20 Thread Raymond Hettinger
Raymond Hettinger added the comment: Unassigning. If someone is interested creating a patch, I think it is a reasonable request. -- assignee: rhettinger -> priority: low -> normal stage: -> needs patch versions: -Python 2.7 ___ Python tracker <

[issue6305] islice doesn't accept large stop values

2009-06-23 Thread Raymond Hettinger
Raymond Hettinger added the comment: Clarified the error message in r73535. Leaving open as a feature request to support arbitrarily large indices. -- components: +Extension Modules type: behavior -> feature request versions: +Python 2.7, Python 3.2 -Python 3.0 ___

[issue6305] islice doesn't accept large stop values

2009-06-18 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> rhettinger nosy: +rhettinger priority: -> low ___ Python tracker ___ ___ Python-bugs-l

[issue6305] islice doesn't accept large stop values

2009-06-18 Thread Thomas Guest
New submission from Thomas Guest : Python 3.0 (r30:67503, Jan 7 2009, 16:22:01) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin >>> from itertools import islice, count >>> islice(count(), (1<<31) - 1) >>> islice(count(), (1<<31)) Traceback (most recent call last): File "", line 1, i