[Python-Dev] non-integer slice indices?

Finn Bock bckfnn@worldonline.dk
Sat, 12 Feb 2000 19:38:43 GMT


[Skip asks about noninteger slices]

>     foo['a':'abc'] = some_sequence
>

[Greg writes]
>Now... altering the syntax and semantic restrictions (to make it easier)  
>is surely possible, but yah: let's hear some motivations from Viorel.

What about getting full compatibility with jpython <wink> as motivation:


JPython 1.1 on java1.3.0rc1 (JIT: null)
Copyright (C) 1997-1999 Corporation for National Research Initiatives
>>> class A:
...    def __setitem__(self, idx, value):
...        print "__setitem__", `idx`, value
...
>>> A()['a':'d'] = '1234'
__setitem__ slice('a', 'd', 1) 1234
>>>

regards,
finn