Skip to content

Instantly share code, notes, and snippets.

@Kwpolska
Created June 19, 2016 17:04
Show Gist options
  • Save Kwpolska/ec3a86aa5fad40cbcf9dce16c8295a0e to your computer and use it in GitHub Desktop.
Save Kwpolska/ec3a86aa5fad40cbcf9dce16c8295a0e to your computer and use it in GitHub Desktop.
def foobar(number):
return "Number is %d" % number
class GenericFoo(object):
foo = None
def do_things(self):
print(self.foo(7))
class CustomFoo(GenericFoo):
foo = foobar
cf = CustomFoo()
cf.do_things()
# Traceback (most recent call last):
# File "generic-issue.py", line 13, in <module>
# cf.do_things()
# File "generic-issue.py", line 7, in do_things
# print(self.foo(7))
# TypeError: foobar() takes 1 positional argument but 2 were given
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment