[Python-3000] xrange vs. int.__getslice__

Diogo Kollross diogoko at gmail.com
Tue Jul 4 14:59:39 CEST 2006


> It is how much possible to understand slice in Python language is a
> reception of a range of values with the certain step. By default this
> step is equal to 1 for objects of any type. It is possible to assume,
> that the similar behaviour can be at types float, decimal, long and
> other. As the method __getslice__ till now is not involved by any
> image for numbers.

How the following case should work?

class even(int):
.. "Only the even integers..."

for i in even[:100]:
.. do something


More information about the Python-3000 mailing list