A
Antoon Pardon
I know this PEP is rejected. However I have a problem that
would benefit from having extreme values and the sample
implementation that is given in the PEP is unsatifactory
for my purpose.
I had written my own module, which works similarly but
is somewhat extended. Here is an example of how it can
be used and how I would like to use it but get stuck.
from extreme import Top
File "<stdin>", line 1, in ?
TypeError: slice indices must be integers or None
So this is where I am stuck. I need this Top value in
a context where it can be used as a start or stop value
in a slice. My idea was that since a stop value greater
than the length of lst in this context would simply return
a copy of lst, using Top in such a way should behave so
too. However I don't see a way of doing that.
So can someone provide ideas to get this behaviour?
If not is there a chance that PEP 326 gets revived?
would benefit from having extreme values and the sample
implementation that is given in the PEP is unsatifactory
for my purpose.
I had written my own module, which works similarly but
is somewhat extended. Here is an example of how it can
be used and how I would like to use it but get stuck.
from extreme import Top
Traceback (most recent call last):Top Top
Top + 1 Top
Top - 30 Top
Top > 1e99 True
lst = range(10)
lst[:Top]
File "<stdin>", line 1, in ?
TypeError: slice indices must be integers or None
So this is where I am stuck. I need this Top value in
a context where it can be used as a start or stop value
in a slice. My idea was that since a stop value greater
than the length of lst in this context would simply return
a copy of lst, using Top in such a way should behave so
too. However I don't see a way of doing that.
So can someone provide ideas to get this behaviour?
If not is there a chance that PEP 326 gets revived?