Binding class methods to external functions
methods, oop, python
Solution
A simple way to do it is to wrap the function in a `staticmethod` inside A:
class A():
bar = staticmethod(foo)
>>> test = A()
>>> test.bar()
Hello world
Problem
I get an error when trying to bind a class method to a function. Why? ``` def foo(): print "Hello world" class something(object): bar = foo test = something() test.bar() TypeError: foo() takes no arguments (1 given) ``` Also, if I am unable to modify `foo`, can I do this adaptation from within the class definition?