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/2002-October/029766.html below:

[Python-Dev] Patch to use dict subclasses in eval(), exec

[Python-Dev] Patch to use dict subclasses in eval(), execGuido van Rossum guido@python.org
Tue, 29 Oct 2002 07:09:22 -0500
> @@ -1696,9 +1701,10 @@
>  			}
>  			x = PyDict_GetItem(x, w);
>  			if (x == NULL) {
> -				x = PyDict_GetItem(f->f_globals, w);
> +				x = (fastglobals ? PyDict_GetItem : PyObject_GetItem)(f->f_globals, w);
>  				if (x == NULL) {
> -					x = PyDict_GetItem(f->f_builtins, w);
> +					if (!fastglobals) PyErr_Clear();
> +					x = (slowbuiltins ? PyObject_GetItem : PyDict_GetItem)(f->f_builtins, w);
>  					if (x == NULL) {
>  						format_exc_check_arg(
>  							    PyExc_NameError,

I don't see the extra DECREF here (and below) needed to compensate for
the fact that PyObject_GetItem() returns the object with incremented
refcount but PyDict_GetItem() doesn't.

What are you going to do with all the *other* places where
PyDict_GetItem() is used?

--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