Title: 2.3.3 str & list still use __getslice__ / __setslice__
Type: Stage:
Components: None Versions:
Status: closed Resolution: later
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, oodoo, terry.reedy
Priority: normal Keywords:

Created on 2004-01-29 15:47 by oodoo, last changed 2007-08-23 20:18 by georg.brandl. This issue is now closed.

Messages (4)
msg19849 - (view) Author: ibo (oodoo) Date: 2004-01-29 15:47
Python 2.3.3 (#1, Jan 13 2004, 17:45:56)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2

str and list still use __getslice__ / __setslice__ for
the binary form

foo = mystr[1:2]
mystr[1:2] = foo

instead of __getitem__ / __setitem__ with slice objects.

msg19850 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2004-02-03 02:03
Logged In: YES 

This only strikes me as a bug if use of *item is specified 
somewhere so that people subclassing builtin seqs know 
which methods to override.  Is it?  Are tuples different or just 
not checked?  
msg19851 - (view) Author: ibo (oodoo) Date: 2004-02-03 21:04
Logged In: YES 

Jep, I noticed it while subclassing and overriding the
operators for slicing.
It's odd to deprecate a feature, and force the programmer to
use it anyway if he wants to sublcass existing types.

Is there an explicit typename for tuples? 
msg55199 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2007-08-23 20:18
This won't change until Py3k, where the old __fooslice__ methods will be
Date User Action Args
2007-08-23 20:18:02georg.brandlsetstatus: open -> closed
resolution: later
messages: + msg55199
nosy: + georg.brandl
2004-01-29 15:47:04oodoocreate