On Sun, Jun 18, 2017 at 07:21:21PM +0100, Barry Scott <ba...@barrys-emacs.org> 
wrote:
> I was going to simply keep track of the names of the modules that are being 
> imported
> and raise an exception if an import attempted to import a module that had not 
> completed
> being imported.

   Please don't do that. In SQLObject module dbconnection imports
connection modules to run registration code in their __init__;
connection modules import name DBAPI from dbconnection. To avoid
problems with circular import dbconnection imports connection modules at
the very end.
   I'm afraid you plan if implemented would prevent me from doing that.

   See the code. dbconnection.py:
https://github.com/sqlobject/sqlobject/blob/master/sqlobject/dbconnection.py#L1099

   Connection modules (just a few examples):
https://github.com/sqlobject/sqlobject/blob/master/sqlobject/mysql/mysqlconnection.py#L5
https://github.com/sqlobject/sqlobject/blob/master/sqlobject/postgres/pgconnection.py#L7

Oleg.
-- 
     Oleg Broytman            http://phdru.name/            p...@phdru.name
           Programmers don't die, they just GOSUB without RETURN.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to