Can we give built-in `help` function a `__qualname__` attribute
Hi, A lot of python's built-in functions have an attribute named __qualname__. However, the built-in `help` function has no __qualname__ attribute. In a future version of python can we have: help.__qualname__ = "help"
On Sat, 8 Apr 2023 at 03:45, Samuel Muldoon <muldoonsamuel@gmail.com> wrote:
Hi,
A lot of python's built-in functions have an attribute named __qualname__.
However, the built-in `help` function has no __qualname__ attribute.
In a future version of python can we have:
help.__qualname__ = "help"
That sounds like a reasonable request. Open an issue for it on the bug tracker. Michael
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/PKBVAC... Code of Conduct: http://python.org/psf/codeofconduct/
-- Michael Foord Python Consultant, Contractor and Trainer https://agileabstractions.com/
The help function is not a built-in but an instance of a class defined in _sitebuiltins. Like other instances, it has neither __qualname__ nor __name__, but its __class__ does. On Fri, Apr 7, 2023 at 7:46 PM Samuel Muldoon <muldoonsamuel@gmail.com> wrote:
Hi,
A lot of python's built-in functions have an attribute named __qualname__.
However, the built-in `help` function has no __qualname__ attribute.
In a future version of python can we have:
help.__qualname__ = "help"
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/PKBVAC... Code of Conduct: http://python.org/psf/codeofconduct/
On Mon, Apr 10, 2023 at 12:39 PM Jeremiah Paige <ucodery@gmail.com> wrote:
The help function is not a built-in but an instance of a class defined in _sitebuiltins. Like other instances, it has neither __qualname__ nor __name__, but its __class__ does.
indeed: In [*7*]: help.__class__.__qualname__ Out[*7*]: '_Helper' One of the tricks with Python is that not all Callables are functions -- even if they appear to be. Why do you want a __qualname__ for help? -CHB On Fri, Apr 7, 2023 at 7:46 PM Samuel Muldoon <muldoonsamuel@gmail.com>
wrote:
Hi,
A lot of python's built-in functions have an attribute named __qualname__ .
However, the built-in `help` function has no __qualname__ attribute.
In a future version of python can we have:
help.__qualname__ = "help"
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/PKBVAC... Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/RJSQTN... Code of Conduct: http://python.org/psf/codeofconduct/
-- Christopher Barker, PhD (Chris) Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython
participants (4)
-
Christopher Barker
-
Jeremiah Paige
-
Michael Foord
-
Samuel Muldoon