pytwo.py 393 B

12345678910111213141516171819202122232425262728293031323334
  1. class MyClass(object):
  2. def __init__(self):
  3. self.string = "test string"
  4. @staticmethod
  5. def print_string():
  6. print "hi"
  7. def foo():
  8. return new_my_class()
  9. def fooo(*args, **kwargs):
  10. return "fooo"
  11. new_my_class = MyClass
  12. new_my_class.print_string()
  13. foo().print_string()
  14. MyClass = fooo
  15. new_foo = MyClass
  16. print(new_foo)
  17. # new_my_class = MyClass()
  18. # new_my_class.print_string()