This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author taleinat
Recipients eamanu, rhettinger, samwyse, taleinat
Date 2020-09-25.19:14:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1601061262.61.0.393726226471.issue29940@roundup.psfhosted.org>
In-reply-to
Content
To clarify, to my understanding the issue here is that when using a class as a decorator, and copying the wrapped function's __doc__ to self.__doc__ in __init__, help() will pick up the wrapper class's __doc__ rather than the instance's __doc__.

For example:

class Deco:
    "A decorator."
    def __init__(self, func):
        functools.update_wrapper(self, func)
    def __call__(self, *args, **kwargs):
        pass

@Deco
def double(n):
    "A function."
    return n * 2

help(double) will show "A decorator." rather than "A function." despite the use of functools.update_wrapper().
History
Date User Action Args
2020-09-25 19:14:22taleinatsetrecipients: + taleinat, rhettinger, samwyse, eamanu
2020-09-25 19:14:22taleinatsetmessageid: <1601061262.61.0.393726226471.issue29940@roundup.psfhosted.org>
2020-09-25 19:14:22taleinatlinkissue29940 messages
2020-09-25 19:14:22taleinatcreate