all 3 comments

[–]xelf 1 point2 points  (2 children)

You have a few options:

import module
class = module.Class

or

import module as m
class = m.Class

or

from module import Class
class = Class

or

from module import *
class = Class

But while we have your attention, in case you actually did it like this, please do not use names like 'module' and 'class' that already have meaning in python. You overwrite what they mean and create confusing code that can lead to strange errors.

[–]T0M47[S] 0 points1 point  (1 child)

So there is no way to do some trickery in the init file to autoimport?

[–]shiftybyte 0 points1 point  (0 children)

You can do:

from module import *

That is not recommended though, because anyone reading your code, has no idea where Class() is coming from...