[Python-checkins] r42298 - peps/trunk/pep-0357.txt
guido.van.rossum
python-checkins at python.org
Thu Feb 9 23:26:02 CET 2006
Author: guido.van.rossum
Date: Thu Feb 9 23:26:00 2006
New Revision: 42298
Modified:
peps/trunk/pep-0357.txt
Log:
Update from Travis -- move to make it a numeric slot.
Modified: peps/trunk/pep-0357.txt
==============================================================================
--- peps/trunk/pep-0357.txt (original)
+++ peps/trunk/pep-0357.txt Thu Feb 9 23:26:00 2006
@@ -10,7 +10,7 @@
Abstract
- This PEP proposes adding an sq_index slot in PySequenceMethods and
+ This PEP proposes adding an nb_as_index slot in PyNumberMethods and
an __index__ special method so that arbitrary objects can be used
in slice syntax.
@@ -32,20 +32,21 @@
Proposal
- Add a sq_index slot to PySequenceMethods, and a corresponding
+ Add a nb_index slot to PyNumberMethods, and a corresponding
__index__ special method. Objects could define a function to
- place in the sq_index slot that returns an C-integer for use in
- PySequence_GetSlice, PySequence_SetSlice, and PySequence_DelSlice.
+ place in the sq_index slot that returns an appropriate
+ C-integer for use as ilow or ihigh in PySequence_GetSlice,
+ PySequence_SetSlice, and PySequence_DelSlice.
Implementation Plan
1) Add the slots
- 2) Change the ISINT macro in ceval.c to accomodate objects with the
- index slot defined.
+ 2) Change the ISINT macro in ceval.c to ISINDEX and alter it to
+ accomodate objects with the index slot defined.
3) Change the _PyEval_SliceIndex function to accomodate objects
- with the index slot defined.
+ with the index slot defined.
Possible Concerns
More information about the Python-checkins
mailing list