Skip to content
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

pydoc does not show unbound methods of builtin classes as module members #113942

Closed
serhiy-storchaka opened this issue Jan 11, 2024 · 1 comment
Closed
Assignees
Labels
3.13 new features, bugs and security fixes

Comments

@serhiy-storchaka
Copy link
Member

serhiy-storchaka commented Jan 11, 2024

If you set an unbound method of builtin class as a module global, pydoc will not show it in the module output. It shows builtin functions and static methods, class methods and bound instance methods of builtin classes.

list_count = list.count  # not shown
list_repr = list.__repr__  # not shown
builtin_ord = ord
str_maketrans = str.maketrans
dict_fromkeys = dict.fromkeys
dict_get = {}.get

Linked PRs

@serhiy-storchaka serhiy-storchaka self-assigned this Jan 11, 2024
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this issue Feb 11, 2024
Pydoc no longer skips global functions implemented as builtin methods,
such as MethodDescriptorType and WrapperDescriptorType.
serhiy-storchaka added a commit that referenced this issue Feb 26, 2024
Pydoc no longer skips global functions implemented as builtin methods,
such as MethodDescriptorType and WrapperDescriptorType.
@serhiy-storchaka
Copy link
Member Author

I am not sure whether it is worth to backport. It does not make difference for the stdlib, so it is safer to not backport. But we can backport if we get real world examples.

@serhiy-storchaka serhiy-storchaka added the 3.13 new features, bugs and security fixes label Feb 26, 2024
woodruffw pushed a commit to woodruffw-forks/cpython that referenced this issue Mar 4, 2024
…nGH-115306)

Pydoc no longer skips global functions implemented as builtin methods,
such as MethodDescriptorType and WrapperDescriptorType.
adorilson pushed a commit to adorilson/cpython that referenced this issue Mar 25, 2024
…nGH-115306)

Pydoc no longer skips global functions implemented as builtin methods,
such as MethodDescriptorType and WrapperDescriptorType.
diegorusso pushed a commit to diegorusso/cpython that referenced this issue Apr 17, 2024
…nGH-115306)

Pydoc no longer skips global functions implemented as builtin methods,
such as MethodDescriptorType and WrapperDescriptorType.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.13 new features, bugs and security fixes
Projects
None yet
Development

No branches or pull requests

1 participant