28 Mar
2002
28 Mar
'02
10:22 p.m.
How about doing it both ways: if you try to pass start/stop for an iterator instead of a sequence, you get an AttributeError on __getindex__. (I'm not proposing this, just throwing it out as an idea. It does make explaining it more difficult, which is an argument against.)
The more complexity is suggested, the more I like my simplest variant. --Guido van Rossum (home page: http://www.python.org/~guido/)