help() of a method wrongly identifies it as a module-level function
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 36k
- PR merge metrics
- PR metrics pending
Description
Consider the following class:
class K:
def verbify(self):
"""Docstring"""
help() on the unbound method (actually a function) K.verbify wrongly identifies it as a module-level function, displaying this in Python3.10:
Help on function verbify in module __main__:
verbify(self)
Docstring
It should identify the function using __qualname__ rather than __name__':
>>> K.verbify.__qualname__
'K.verbify'
>>> K.verbify.__name__
'verbify'
In contrast, help() on the bound method correctly identifies that verbify is a method belonging to K: help(K().verbify) displays verbify() method of __main__.K instance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the provided K.verbify example and compare help(K.verbify) with help(K().verbify). Trace the implementation used by help() and update the unbound-function description to use qualname; done when it identifies K.verbify while preserving the existing bound-method description.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- developer-experience
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100