Bugs item #1712236, was opened at 2007-05-03 13:20 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1712236&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Interpreter Core Group: None >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Imri Goldberg (lorgandon) Assigned to: Nobody/Anonymous (nobody) Summary: __getslice__ changes integer arguments Initial Comment: When using slicing for a sequence object, with a user defined __getslice__ function, the arguments to __getslice__ are changed. This does not happen when __getslice__is called directly. Attached is some code that demonstrates the problem. I checked it on various versions, including my "Python 2.5.1 (r251:54863, May 2 2007, 16:56:35)", on my Ubuntu machine. Although __getslice__ is deprecated, there is still usage of the function, and a fix would be useful. ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2007-05-18 18:51 Message: Logged In: YES user_id=80475 Originator: NO Unfortunately, this is a feature, not a bug. The relevant code is in Python/ceval.c apply_slice(). Calls to s[a:b] get pre-processed before being handed-off to s.__getslice__. This behavior has been around so long, that it is almost certain that there is a good body of existing code that relies on the behavior. ---------------------------------------------------------------------- Comment By: Imri Goldberg (lorgandon) Date: 2007-05-03 13:23 Message: Logged In: YES user_id=1715564 Originator: YES This also seems to be the cause of bug "[ 908441 ] default index for __getslice__ is not sys.maxint" ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1712236&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com