t543.py 310 B

12345678910
  1. class MyClass:
  2. def my_method(self, mandatory_arg, x=0, y=0, **more_args):
  3. print "Hello! x = " + str(x)
  4. print "Hello! bla = " + str(more_args['bla'])
  5. def my_method2(self):
  6. self.my_method("hi", y=2, bla='from method2')
  7. k = MyClass()
  8. k.my_method('test', x=5, bla='seven')
  9. k.my_method2()