-
-
Notifications
You must be signed in to change notification settings - Fork 30.6k
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: better support of method aliases #79147
Comments
Pydoc supports aliases. If the alias is defined in the same class class A:
def foo(self, x=42): pass
bar = foo it will render the docstring only for the original function. For the alias it will output just "bar = foo(self, x=42)". But this doesn't work if the original function or alias are inherited. It often happened in the tkinter and turtle modules which have a hierarchy of classes, and aliases defined in parent classes. Compare for example the rendering for methods itemconfig and lift in help(tkinter.Listbox). The proposed PR makes pydoc detecting aliases for inherited methods. |
What do you mean by 'does not work'. Alias of function in same namespace. | itemconfig = itemconfigure(self, index, cnf=None, **kw) Alias of function in inherited namespace. | lift = tkraise(self, aboveThis=None) This is also marked as an alias. The difference is the inclusions of the docstring of the original. I think it should be, since it would not otherwise be present in the help output. |
The original function is present too. | tkraise(self, aboveThis=None) |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: