On 2/9/06, Travis E. Oliphant <oliphant.travis at ieee.org> wrote: ... > 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. Shouldn't that new API function (whatever its name) also be somehow exposed for easy access from Python code? I realize new builtins are unpopular, so a builtin 'asindex' might not be appropriate, but perhaps operator.asindex might be. My main point is that I don't think we want every Python-coded sequence to have to call x.__index__() instead. Alex
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