Message65802
I guess there needs to be a decision on whether to make range objects of
length >= PY_SSIZE_T_MAX illegal; perhaps more discussion on python-dev
would be worthwhile?
I can see three options, besides leaving things as they are:
(1) make large ranges illegal, as with this patch
(2) make large ranges legal, but don't allow indexing with indices
larger than PY_SSIZE_T_MAX.
(3) allow large ranges *and* large indices.
Option 3 seems to me like the ideal from the users' point of view, but I'm
not sure whether it's easy/possible to implement it given that sq_item
receives a Py_ssize_t for the index.
Option 2 seems messy: half of one thing and half of the other, but I
think it would be easy to implement. This is what I'd personally prefer
if Option 3 isn't feasible.
If Option 1 is indeed the preferred option, then the patch looks good to
me, and works for me on OS X 10.5. (Minor nitpick: it introduces some
extra tab characters.)
Whatever happens, we probably also need a documentation update explaining
the limitations on range. |
|
| Date |
User |
Action |
Args |
| 2008-04-25 18:48:03 | marketdickinson | set | spambayes_score: 0.019503 -> 0.019503 recipients:
+ marketdickinson, belopolsky |
| 2008-04-25 18:48:02 | marketdickinson | set | spambayes_score: 0.019503 -> 0.019503 messageid: <1209149282.65.0.442237787445.issue2690@psf.upfronthosting.co.za> |
| 2008-04-25 18:48:01 | marketdickinson | link | issue2690 messages |
| 2008-04-25 18:47:59 | marketdickinson | create | |
|