Is it  worth while to defer the import of a large module that seldom
gets used in the script?


        import sys
        import os

        if hardly_ever_happens():
                
                import large_module
                large_module.do_task()



I imagine it takes a certain amount of processing
power and memory to import a module, so it seems
like I'd save those resources with the above pattern.

The down side would be that it's nice to see all of the
imports at the top which would follow convention.  Should
I care?


Tobiah



--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to