Documentation
In the tutorial "MyClass" class discussion, MyClass is defined as follows.
class MyClass:
"""A simple example class"""
i = 12345
def f(self):
return 'hello world'
In the method object section, x.f() is said to be normally called after it is bound, however this statement ends in error, "Missing 1 required positional argument 'self'
Then it states the following script will repeat forever, however it gets the same error Missing 1 required positional argument 'self'
xf = x.f
while True:
print(xf())
To fix the issue remove the "self" from method f() as below and everything works as intended.
def f():
return 'hello world'
Linked PRs
Documentation
In the tutorial "MyClass" class discussion, MyClass is defined as follows.
In the method object section,
x.f()is said to be normally called after it is bound, however this statement ends in error, "Missing 1 required positional argument 'self'Then it states the following script will repeat forever, however it gets the same error Missing 1 required positional argument 'self'
To fix the issue remove the "self" from method f() as below and everything works as intended.
Linked PRs