Python: Import Exception
Question: Is it possible to import everything except one module from a package?

I need a lot of modules from a particular library that I use in my class, but
it looks like it used the same module name for one of the modules that I need.

I need to use set operation and intersection, but when I import that library
from my class, it gives me an error because of that.

I didn't want to import it separately or put the name in front of every
methods since I'm using it a lot.

Is there a way for the python to import everything except for a particular
method like `set`? Or maybe import the `set` part again later?


Answer: No, there is no terminology to `from ... import * except blah, bleh, bluh`.
You can either write your own import function to support it, or do something
like:

    
    
    from xyz import *
    del set
    

which will stop shadowing the built-in `set` so you can use it again. Then if
you need the `xyz.set` function you can do:

    
    
    from xyz import set as xyzset
    

Note: `from ... import *` is not _usually_ good practice, and you should make
sure the modules you are using this way support it -- if they don't explicity
say they were designed to be used this way, then you shouldn't (unless you
enjoy debugging weird problems later ;).

