I'm not sure Droping imports is the best way to go, since every python script/app will import common modules right on the start and it will still seem like the interpeter boot is slow.
making modules load faster seems like a better approch On Thu, Oct 10, 2013 at 3:18 AM, Eric Snow <ericsnowcurren...@gmail.com>wrote: > On Wed, Oct 9, 2013 at 8:30 AM, Christian Heimes <christ...@python.org> > wrote: > > The os module imports MutableMapping from collections.abc. That import > > adds collections, collections.abc and eight more modules. I'm not sure > > if we can do anything about it, though. > > Well, that depends on how much we want to eliminate those 10 imports. > :) Both environ and environb could be turned into lazy wrappers > around an _Environ-created-when-needed. If we used a custom module > type for os [1], then adding descriptors for the two attributes is a > piece of cake. As it is, with a little metaclass magic (or even with > explicit wrapping of the various dunder methods), we could drop those > 10 imports from startup. > > -eric > > [1] This probably wouldn't be a great idea considering that > undoubtedly some code depends on "type(os) is types.ModuleType". > _______________________________________________ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/yoavglazner%40gmail.com >
_______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com