On Sat, Nov 14, 2020 at 04:32:20AM +0000, Steve Barnes wrote:

> I love the idea of __imported__ but would like to suggest taking it 
> even further - why not, rather that a bool for __imported__, have the 
> value of it be either None (if __name__ == "__main__")

What if you imported `__main__`?


> or the __name__ of the module that it is being imported from. 

What if it has been imported from many modules, as most modules will be?


> This could potentially 
> be useful in trying to resolve circular imports, imports via importlib 
> or exec, etc.

"Potentially" useful? How?

By the way, exec doesn't do an import of the code being run.


-- 
Steve
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/BMANTUMJEK4FJUVWN4XZOWMTTUOM5UD2/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to