A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-February/060650.html below:

[Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notation

[Python-Dev] PEP for adding an sq_index slot so that any object, a or b, can be used in X[a:b] notationThomas Wouters thomas at xs4all.net
Fri Feb 10 00:27:34 CET 2006
On Thu, Feb 09, 2006 at 02:32:47PM -0800, Brett Cannon wrote:
> Looks good to me.  Only change I might make is mention why __int__
> doesn't work sooner (such as in the rationale).  Otherwise +1 from me.

I have a slight reservation about the name. On the one hand it's clear the
canonical use will be for indexing sequences, and __index__ doesn't look
enough like __int__ to get people confused on the difference. On the other
hand, there are other places (in C) that want an actual int, and they could
use __index__ too. Even more so if a PyArg_Parse* grew a format for 'the
index-value for this object' ;)

On the *other* one hand, I can't think of a good name... but on the other
other hand, it would be awkward to have to support an old name just because
the real use wasn't envisioned yet.

One-time-machine-for-the-shortsighted-quadrumanus-please-ly y'r,s
-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4