[Python-ideas] Quick idea: defining variables from functions that take the variable name
Steven D'Aprano
steve at pearwood.info
Fri Jun 3 01:15:13 EDT 2016
On Thu, Jun 02, 2016 at 02:55:25PM +0200, Piotr Duda wrote:
> I want to extend it to: some object also need to know module they're
> declared and their own qualified name (for example for pickling support).
If you are serious about this, then you should start a thread about it.
You should give some examples of which objects need this, and how people
currently solve the problem, and why it is unsuitable.
If I have understood you correctly, the usual solution to this is to use
sys._getframe(1). I don't know what Jython and IronPython use.
--
Steve
More information about the Python-ideas
mailing list