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/2005-October/056901.html below:

[Python-Dev] Why does __getitem__ slot of builtin call sequence methods first?

[Python-Dev] Why does __getitem__ slot of builtin call sequence methods first? [Python-Dev] Why does __getitem__ slot of builtin call sequence methods first?Travis Oliphant oliphant at ee.byu.edu
Sun Oct 2 01:39:24 CEST 2005
The new ndarray object of scipy core (successor to Numeric Python) is a 
C extension type that has a getitem defined in both the as_mapping and 
the as_sequence structure. 

The as_sequence mapping is just so PySequence_GetItem will work correctly.

As exposed to Python the ndarray object as a .__getitem__  wrapper method.

Why does this wrapper call the sequence getitem instead of the mapping 
getitem method?

Is there anyway to get at a mapping-style __getitem__ method from Python?

This looks like a bug to me (which is why I'm posting here...)

Thanks for any help or insight.

-Travis Oliphant



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