Seek support for new slice syntax PEP.
Nobody
nobody at nowhere.com
Fri Dec 18 23:16:55 EST 2009
On Fri, 18 Dec 2009 09:49:26 -0500, Colin W. wrote:
> You don't say, but seem to imply that the slice components include None.
That's how missing components are implemented at the language level:
> class foo:
= def __getitem__(self, s):
= return s
=
> x = foo()
> x[::]
slice(None, None, None)
> x[1::2]
slice(1, None, 2)
The defaults of zero, sys.maxint and one apply to built-in types, but
nothing forces user-defined types to behave this way.
Or maybe I misunderstood your point.
More information about the Python-list
mailing list