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/2003-March/034107.html below:

[Python-Dev] Who approved PyObject_GenericGetIter()???

[Python-Dev] Who approved PyObject_GenericGetIter()???Guido van Rossum guido@python.org
Mon, 17 Mar 2003 07:26:24 -0500
> Modified Files:
> 	object.c 
> Log Message:
> Created PyObject_GenericGetIter().
> Factors out the common case of returning self.
> 
> 
> 
> Index: object.c
> ===================================================================
> RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v
> retrieving revision 2.199
> retrieving revision 2.200
> diff -C2 -d -r2.199 -r2.200
> *** object.c	19 Feb 2003 03:19:29 -0000	2.199
> --- object.c	17 Mar 2003 08:22:56 -0000	2.200
> ***************
> *** 1302,1305 ****
> --- 1302,1312 ----
>   
>   PyObject *
> + PyObject_GenericGetIter(PyObject *obj)
> + {
> + 	Py_INCREF(obj);
> + 	return obj;
> + }
> + 
> + PyObject *
>   PyObject_GenericGetAttr(PyObject *obj, PyObject *name)
>   {

Huh?  Where was this agreed upon?  __iter__ returning self doesn't
sound very generic to me, so at the very least the name should be
changed IMO.  Also, adding a standard API for a helper function this
trivial doesn't really make sense to me.

So maybe I'm missing something.  Please explain.

--Guido van Rossum (home page: http://www.python.org/~guido/)



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