Skip to content

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

terryjreedy
Copy link
Member

@terryjreedy terryjreedy commented Aug 21, 2025

x must be a MyClass instance for examples to work.


📚 Documentation preview 📚: https://cpython-previews--138014.org.readthedocs.build/

x must be a MyClass instance for examples to work.
@terryjreedy terryjreedy self-assigned this Aug 21, 2025
@terryjreedy terryjreedy added docs Documentation in the Doc dir skip news needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Aug 21, 2025
@github-project-automation github-project-automation bot moved this to Todo in Docs PRs Aug 21, 2025
@terryjreedy
Copy link
Member Author

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'``.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting core review docs Documentation in the Doc dir needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes skip news
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

2 participants