26 Sep
2014
26 Sep
'14
9:35 p.m.
Steven D'Aprano wrote:
By making importing automatic, every failed attribute access has to determine whether or not there is a sub-module to import, which could be quite expensive.
Another thing to consider is that code executed during an import runs with the import lock held. This can lead to surprises in multi-threaded code. I got caught out by it once, and it took me a while to figure out what was going on. As long as the import lock exists, it's probably better for importing to remain an eplicit action, at least by default. -- Greg