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/060659.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] notationTravis E. Oliphant oliphant.travis at ieee.org
Fri Feb 10 02:09:27 CET 2006
Guido van Rossum wrote:
> On 2/9/06, Travis Oliphant <oliphant.travis at ieee.org> wrote:
> 
> 
> This is very close to acceptance. I think I'd like to see the patch
> developed and submitted to SF (and assigned to me) prior to
> acceptance.
> 
> 
>>Copyright
>>
>>   This document is placed in the public domain
> 
> 
> If you agree with the above comments, please send me an updated
> version of the PEP and I'll check it in over the old one, and approve
> it. Then just use SF to submit the patch etc.
> 

I uploaded a patch to SF against current SVN.  The altered code compiles 
and the functionality works with classes defined in Python.  I have yet 
to test against a C-type that defines the method.

The patch adds a new API function int PyObject_AsIndex(obj).

This was not specifically in the PEP but probably should be.  The name 
could also be PyNumber_AsIndex(obj)  but I was following the nb_nonzero 
slot example to help write the code.

-Travis



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