-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
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
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Projects
Status
Todo