Hacker News new | ask | show | jobs
by d0mine 5298 days ago
You should either remove `self` or bind it differently:

  foo = Foo()
  def hello():
      print("hello, %s" % (foo,))
  foo.hello = hello
`foo` is an instance therefore `self == foo` already.

  def hello(self):
      print("hello, %s" % (self,))
  foo.hello = types.MethodType(hello, foo)