[Python-Dev] PyObject_GenericGetIter()
Thomas Wouters
thomas@xs4all.net
Mon, 17 Mar 2003 16:10:40 +0100
On Mon, Mar 17, 2003 at 09:41:01AM -0500, Raymond Hettinger wrote:
> > Thomas suggested PyObject_GetSelfIter, PyObject_GenericSelfIter,
> > or PyObject_SelfIter. Consistent with the other tp_slot fillers, I
> > suggest PyObject_GenericIter.
> A couple of other thoughts. While Thomas found the "getiter" part
> of the name to be unintuitive, the type of the slot is named (getiterfunc)
> and most of the replaced functions had names like dictiter_getiter,
> enum_getiter, iter_getiter, listiter_getiter, xreadlines_getiter ...
> So, my first preference is the name in the subject line.
But my original point still stands. dictiter_getiter, enum_getiter,
iter_getiter are all fairly clear: they get the iter for an (existing)
dictiter/enum/iter object. PyObject_GenericGetIter does not return an
iterator for a generic object, it's a generic way to return an iterator
*for an iterator*. PyIter_GenericGetIter, PyObject_IterGetIter, etc are
all more descriptive.
I also agree with Guido on that this should not be a public API function
(and if it is, it should be documented <wink>.) Functions that aren't
part of the public API but can't be static should be prefixed with _Py.
--
Thomas Wouters <thomas@xs4all.net>
Hi! I'm a .signature virus! copy me into your .signature file to help me spread!