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-May/024722.html below:

[Python-Dev] __module__ of newly-created extension classes

[Python-Dev] __module__ of newly-created extension classes [Python-Dev] __module__ of newly-created extension classesDavid Abrahams David Abrahams" <david.abrahams@rcn.com
Thu, 30 May 2002 18:00:37 -0400
From: "Guido van Rossum" <guido@python.org>


> > Now I'm wondering if there isn't a better way for Python to get
> > ahold of the current module's __name__ in this case, if you don't
> > want to change what PyEval_GetGlobals() does.
>
> If you can rigorously define "current module" I can propose an API.

A rigorous definition is easy; I can't promise it would always meet
everyone's expectations:

The "current module" is given by the current formula (PyEval_GetGlobals(),
etc.) except when loading an extension module, in which case the current
module is the one most recently created.

I'm not sure, but this might be simplifiable to:

the "current module" is the one most recently created.


-Dave






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