Example:
import user
class Thing(object):
def doSomething(self):
u = user.User(1)
print u.name
>> UnboundLocalError: local variable 'user' referenced before assignment
But this works:
class Thing(object):
def doSomething(self):
import user
u = user.User(1)
print u.name
Thanks for your help!
Edit:
But this works:
import user as anothername
class Thing(object):
def doSomething(self):
u = anothername.User(1)
print u.name