New submission from Stefan Seefeld:

The python documentation states that since python 2.0 __getslice__ is
obsoleted by __getitem__. However, testing with python 2.3 as well as
2.5, I find the following surprising behavior:

class Tuple(tuple):

  def __getitem__(self, i): print '__getitem__', i
  def __getslice__(self, i): print '__getslice__', i

t = Tuple()
t[0] # __getitem__ called with type(i) == int
t[0:2] # __getslice__ called with type(i) == slice
t[0:2:1] # __getitem__ called with type(i) == slice

----------
components: Interpreter Core
messages: 62162
nosy: stefan
severity: major
status: open
title: __getslice__ still called
type: behavior
versions: Python 2.3, Python 2.5

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2041>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to