New submission from Serhiy Storchaka <storchaka+cpyt...@gmail.com>:

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.

----------
components: Library (Lib)
messages: 327593
nosy: serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Pydoc: better support of method aliases
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue34966>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to