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

gh-97959: [pydoc] now help() does not show extra notes for classmethods #98120

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Oct 9, 2022

Demo:

>>> class A:
...    @classmethod
...    def some(cls):
...       pass
... 
>>> help(A)

Before:

Help on class A in module __main__:

class A(builtins.object)
 |  Class methods defined here:
 |
 |  some() from builtins.type
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables (if defined)
 |
 |  __weakref__
 |      list of weak references to the object (if defined)

After:

Help on class A in module __main__:

class A(builtins.object)
 |  Class methods defined here:
 |
 |  some()
 |
 |  ----------------------------------------------------------------------
 |  Data descriptors defined here:
 |
 |  __dict__
 |      dictionary for instance variables (if defined)
 |
 |  __weakref__
 |      list of weak references to the object (if defined)

Note that other use-cases for from note are still supported, I've added MethodType test case especially for that.

@sobolevn
Copy link
Member Author

sobolevn commented Oct 9, 2022

I am not sure about the enum case:

   |  Methods inherited from enum.EnumType:
   |
-  |  __contains__(value)
+  |  __contains__(value) from enum.EnumType
   |      Return True if `value` is in `cls`.

This needs some more work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants