I get some cyclic import problems and I wish to avoid them by importing a module inside a class at a Class level so that the module is available for all methods of that class. How can this be done? Ideally I would like to do something like this in the dummye xample below, but it doesn't work:
class MyClass:
import datetime as dt
def date_now(self):
return dt.datetime.now()
def hour_now(self):
return dt.datetime.now().hour