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/2002-July/026341.html below:

[Python-Dev] Indexing builtin sequences with objects which supply __int__

[Python-Dev] Indexing builtin sequences with objects which supply __int__Guido van Rossum guido@python.org
Fri, 12 Jul 2002 11:26:41 -0400
I've thought about this more, and I think I don't want to make the
requested change (accept objects which implement __int__ as valid
sequence indices).  I also don't want to add a new protocol
(the proposed __index__).

I suggest that you try to find a solution that works without requiring
changes to Python -- that way you have a much better chance that your
code will work with Python 2.2, which will very likely have a lifetime
comparable to that of Python 1.5.2 (in parallel with 2.3, for sure).

I understand your desire to equate 0-D arrays and scalars, but I'm
afraid that's not how the rest of Python works.  I don't think we
should change Python's semantic framework with APL's.

I'm neutral on what you should do instead; personally, I'd continue to
return Python scalars for 0-D arrays, but you could switch to 0-D
arrays if you think the advantages outweigh the disadvantages.

--Guido van Rossum (home page: http://www.python.org/~guido/)




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