class MyClass(object): def __init__(self): self.string = "test string" @staticmethod def print_string(): print "hi" def foo(): return new_my_class() def fooo(*args, **kwargs): return "fooo" new_my_class = MyClass new_my_class.print_string() foo().print_string() MyClass = fooo new_foo = MyClass print(new_foo) # new_my_class = MyClass() # new_my_class.print_string()