help(list[int]) → TypeError

Paul Bryan pbryan at anode.ca
Thu Dec 3 12:19:04 EST 2020


Is this the correct behavior?

Python 3.9.0 (default, Oct  7 2020, 23:09:01) 
[GCC 10.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> help(list[int])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.9/_sitebuiltins.py", line 103, in __call__
    return pydoc.help(*args, **kwds)
  File "/usr/lib/python3.9/pydoc.py", line 2001, in __call__
    self.help(request)
  File "/usr/lib/python3.9/pydoc.py", line 2060, in help
    else: doc(request, 'Help on %s:', output=self._output)
  File "/usr/lib/python3.9/pydoc.py", line 1779, in doc
    pager(render_doc(thing, title, forceload))
  File "/usr/lib/python3.9/pydoc.py", line 1772, in render_doc
    return title % desc + '\n\n' + renderer.document(object, name)
  File "/usr/lib/python3.9/pydoc.py", line 473, in document
    if inspect.isclass(object): return self.docclass(*args)
  File "/usr/lib/python3.9/pydoc.py", line 1343, in docclass
    (str(cls.__name__) for cls in type.__subclasses__(object)
TypeError: descriptor '__subclasses__' for 'type' objects doesn't apply to a 'types.GenericAlias' object
>>> 

I would have expected the output to the identical to help(list).


More information about the Python-list mailing list