On 2/9/06, Travis E. Oliphant <[EMAIL PROTECTED]> 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 _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com