Created
June 19, 2016 17:04
-
-
Save Kwpolska/ec3a86aa5fad40cbcf9dce16c8295a0e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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