Repository navigation
help(list[int]) fails #84476
Copy link
Copy link
Closed
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = <Date 2022-03-19.15:13:37.231>
created_at = <Date 2020-04-15.20:50:17.005>
labels = ['type-bug', 'library', '3.9', '3.10', '3.11']
title = 'help(list[int]) fails'
updated_at = <Date 2022-03-19.15:13:37.230>
user = 'https://github.com/serhiy-storchaka'bugs.python.org fields:
activity = <Date 2022-03-19.15:13:37.230>
actor = 'serhiy.storchaka'
assignee = 'none'
closed = True
closed_date = <Date 2022-03-19.15:13:37.231>
closer = 'serhiy.storchaka'
components = ['Library (Lib)']
creation = <Date 2020-04-15.20:50:17.005>
creator = 'serhiy.storchaka'
dependencies = ['47042']
files = []
hgrepos = []
issue_num = 40296
keywords = ['patch']
message_count = 6.0
messages = ['366558', '366581', '366609', '415473', '415519', '415554']
nosy_count = 4.0
nosy_names = ['gvanrossum', 'serhiy.storchaka', 'JelleZijlstra', 'miss-islington']
pr_nums = ['30253', '31976', '31981']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue40296'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of lifeend of life3.11only security fixesonly security fixes3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
serhiy-storchaka commentedon Apr 15, 2020
serhiy-storchaka commentedon Apr 16, 2020
The problem is that isinstance(list[int], type) returns True, but list[int] is not actually an instance of type.
gvanrossum commentedon Apr 16, 2020
Yeah, I think help() or pydoc needs to special-case this. (Didn't your other PR attempt to fix this?)
Note that issubclass(list[int].__class__, type) returns True -- the __class__ attribute in this case is taken from __origin__, while type() returns the "true" class.
I don't know what to do about __subclasses__ -- I expect we should just let it be this way.
serhiy-storchaka commentedon Mar 18, 2022
New changeset cd44afc by Serhiy Storchaka in branch 'main':
bpo-40296: Fix supporting generic aliases in pydoc (GH-30253)
cd44afc
serhiy-storchaka commentedon Mar 18, 2022
New changeset a5b7678 by Serhiy Storchaka in branch '3.10':
[3.10] bpo-40296: Fix supporting generic aliases in pydoc (GH-30253). (GH-31976)
a5b7678
serhiy-storchaka commentedon Mar 19, 2022
New changeset e207d72 by Miss Islington (bot) in branch '3.9':
[3.9] bpo-40296: Fix supporting generic aliases in pydoc (GH-30253). (GH-31976) (GH-31981)
e207d72