[Python-3000] range() issues

Guido van Rossum guido at python.org
Thu May 1 01:36:24 CEST 2008


On Wed, Apr 30, 2008 at 4:11 PM, Nick Coghlan <ncoghlan at gmail.com> wrote:
>  In the bug tracker, Alexander mentioned the possibility of removing
> __length__ and __getitem__ support from range() objects in py3k, and
> implementing only __length_hint__ instead (leaving range() as a bare-bones
> iterable). I'm starting to like that idea more and more.

Indeed. Do check if it breaks anything though (and how serious the breakage is).

Also note that __bool__ for a range should probably remain implemented
-- True for a non-empty range, False for an empty one.

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list