-
-
Notifications
You must be signed in to change notification settings - Fork 32.6k
gh-138011: Clarify tutorial method object example code #138014
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
x must be a MyClass instance for examples to work.
New version at https://cpython-previews--138014.org.readthedocs.build/en/138014/tutorial/classes.html#method-objects. It looks sufficient to me for the purpose. |
@@ -359,7 +359,7 @@ Usually, a method is called right after it is bound:: | |||
|
|||
x.f() | |||
|
|||
In the :class:`!MyClass` example, this will return the string ``'hello world'``. | |||
If :source:`x = MyClass()`, as above, this will return the string ``'hello world'``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If :source:`x = MyClass()`, as above, this will return the string ``'hello world'``. | |
If ``x = MyClass()``, as above, this will return the string ``'hello world'``. |
Why is it in a source directive? In the rendered docs it will link to as a result: https://github.com/python/cpython/tree/main/x%20=%20MyClass()
x must be a MyClass instance for examples to work.
📚 Documentation preview 📚: https://cpython-previews--138014.org.readthedocs.build/