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/2010-July/101951.html below:

[Python-Dev] More C API abstraction for user defined types

[Python-Dev] More C API abstraction for user defined types [Python-Dev] More C API abstraction for user defined typesNick Coghlan ncoghlan at gmail.com
Thu Jul 15 01:09:31 CEST 2010
On Wed, Jul 14, 2010 at 11:50 PM, Petre Galan <Petre.Galan at gmail.com> wrote:
> No. The right interface is PyNumber_Long. The purpose of the PyNumber_Index (and
> nb_index slot) is as index in slicing.

Allowing other objects to say "I'm a real integer, treat me as one" is
exactly what the nb_index slot is for (see PEP 357). The use as an
index in slicing was just the primary initial use case and the one
that was chosen as the name for the new slot because nb_int was
already taken for the lossy transformation. Indexing is not (and never
has been) intended to be the only use case.
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