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/2013-July/127158.html below:

[Python-Dev] Solving the import-deadlock case

[Python-Dev] Solving the import-deadlock caseR. David Murray rdmurray at bitdance.com
Tue Jul 2 21:41:46 CEST 2013
On Tue, 02 Jul 2013 20:31:48 +0200, Pascal Chambon <pythoniks at gmail.com> wrote:
> I agree that a module loading should be, as much as possible, "side 
> effects free", and thus shouldn't have temporary errors. But well, in 
> practice, module loading is typically the time where process-wide 
> initialization are done (modifying sys.path, os.environ, instantiating 
> connection or thread pools, registering atexit handler, starting 
> maintenance threads...), so that case has chances to happen at a moment 
> or another, especially if accesses to filesystem or network (SQL...) are 
> done at module loading, due to the lack of initialization system at 
> upper levels.

There may well be a bug that could be/should be fixed here, but...it
seems to me that other than the sys.path modifications, doing any of that
at module import time has a strong code smell.

--David
More information about the Python-Dev mailing list

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