Slicing beyond list -- bug or featurette?
William Tanksley
wtanksle at dolphin.openprojects.net
Fri Jul 2 20:00:32 EDT 1999
More information about the Python-list mailing list
Fri Jul 2 20:00:32 EDT 1999
- Previous message (by thread): Slicing beyond list -- bug or featurette?
- Next message (by thread): Slicing beyond list -- bug or featurette?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 2 Jul 1999 22:22:10 GMT, Ivan Van Laningham wrote: >Hi All-- >Pierre Fortin wrote: >> Just ran into a situation which can be summarized as follows: >[bobbitt] >> list[2:50] returns [ 2,3,4 ] >> list[20:] or list[20:30] returns [] >> Can I count on this, or should I code try/except for the day it's >I don't presume to speak for Guido, but the way slicing is implemented >it seems likely that you can count on it: list[:] is implemented as if Furthermore, this makes fundamental sense -- an array reference is defined to return the item stored at that location. A slice is defined to return a list containing the items within those locations. An empty list is still a list; an item that doesn't exist, however, is hard to return. ><but-they-don't-call-him-guido-svetz-for-nothing>-ly y'rs, >Ivan;-) We-have-VAYS-of-justifying-vhat-we-vant-ly y'rs, -- -William "Billy" Tanksley
- Previous message (by thread): Slicing beyond list -- bug or featurette?
- Next message (by thread): Slicing beyond list -- bug or featurette?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list