is importing redundantly harmful/wasteful?

P

python

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 they've been imported?
Does python do some sort of checking for this stuff or do I need to?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,164
Messages
2,570,901
Members
47,440
Latest member
in3dagenonline

Latest Threads

Top