12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- 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()
|