is importing redundantly harmful/wasteful?

Pettersen, Bjorn S BjornPettersen at
Tue Sep 16 20:45:49 CEST 2003

> From: python at [mailto:python at] 
> I'm writing a function and it needs to use regular expressions and the
> super-fantastic mx.DateTime module.  The first lines after 
> the doc string
> in the function are:
>     import re, mx.DateTime
> I'll be using this function in a bunch of different programs.  Some of
> those programs might need re and mx.DateTime for other tasks.
> In some cases, I'll be redundantly importing these modules.  
> Should I care if I'm re-importing re and mx.DateTime even after
> been imported? 


> Does python do some sort of checking for this stuff 


> or do I need to?


-- bjorn

More information about the Python-list mailing list