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() # def my_decorator(dec_str): # def wrapper(func): # # print dec_str # print "before my func" # func() # print "after my_func" # return wrapper # @my_decorator("to decorator") # def foo(): # print "my_function" # foo()