if '##star ##*': # Never use this except for bad practice. # Makes it very hard to know what is being imported or not and what is its name! from d import * assert a2.f() == "d.a2.f()" assert d2.f() == "d.d2.f()" # Can also be used to import module contents: from a import * assert f() == 'a.f()' assert g() == 'a.g()' # If module is a dir, imports both its: from d import * assert f() == 'd.f()' assert a2.f() == 'd.a2.f()' assert d2.f() == 'd.d2.f()' # Will import nothing, since a has no submodules. if '##as': from a import f as g assert g() == 'a.f()'
def main(): print(g(42))
def say_hello(self) -> None: g()