2011/9/23 Ethan Furman <ethan at stoneleaf.us>: > Benjamin Peterson wrote: >> >> 2011/9/23 Ethan Furman <ethan at stoneleaf.us>: > >>> >>> >>> Follow-up question: since the original range returned lists, and >>> comparisons >>> do make sense for lists, should the new range also implement them? >> >> What would be the use-case? > > The only reason I'm aware of at the moment is to prevent loss of > functionality from 2.x range to 3.x range. range comparisons in 2.x have no functionality. > >>> I note >>> that it does implement __contains__, __getitem__, count, and index in the >>> same way that list does. >> >> That's because it implements the Sequence ABC. > > So the question becomes, Why does it implement the Sequence ABC? Because the > original range returned a list and those operations made sense? I'm not sure what the history is. -- Regards, Benjamin
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4