fork download
  1. class Foo:
  2. def hello(self):
  3. print "Hello cruel world!"
  4.  
  5. def greet_first(self, f):
  6. self.hello()
  7. return lambda *args, **kwargs: f(*args, **kwargs)
  8.  
  9. @greet_first
  10. def goodbye(self, concat):
  11. print "Goodbye {0}".format(concat)
  12.  
  13. if __name__=='__main__':
  14. bar = Foo()
  15. bar.goodbye(' and thanks for all the fish')
Runtime error #stdin #stdout 0.07s 8832KB
stdin
Standard input is empty
stdout
Standard output is empty