Repository navigation
Closed
Labels
3.10 (EOL)end of life3.11only security fixes3.9 (EOL)end of lifedocsDocumentation in the Doc direasytype-featureA feature request or enhancement
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 2021-08-31.16:54:04.977>
created_at = <Date 2021-05-14.18:24:27.035>
labels = ['easy', '3.9', '3.10', '3.11', 'type-feature', 'docs']
title = "issubclass documentation doesn't explain tuple semantic"
updated_at = <Date 2021-08-31.16:54:04.977>
user = 'https://bugs.python.org/joaozinho'bugs.python.org fields:
activity = <Date 2021-08-31.16:54:04.977>
actor = 'lukasz.langa'
assignee = 'docs@python'
closed = True
closed_date = <Date 2021-08-31.16:54:04.977>
closer = 'lukasz.langa'
components = ['Documentation']
creation = <Date 2021-05-14.18:24:27.035>
creator = 'joaozinho'
dependencies = []
files = []
hgrepos = []
issue_num = 44135
keywords = ['patch', 'easy', 'newcomer friendly']
message_count = 7.0
messages = ['393684', '393712', '400731', '400737', '400750', '400751', '400756']
nosy_count = 6.0
nosy_names = ['docs@python', 'lukasz.langa', 'miss-islington', 'kj', 'zkneupper', 'joaozinho']
pr_nums = ['26193', '28091', '28094', '28095', '28097']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue44135'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']Metadata
Metadata
Assignees
Labels
3.10 (EOL)end of life3.11only security fixes3.9 (EOL)end of lifedocsDocumentation in the Doc direasytype-featureA feature request or enhancement
Activity
joaozinho commentedon May 14, 2021
The second parameter (classinfo) of the issubclass built-in function can be a Tuple and, starting from 3.10, it can be a Union Type as well.
The documentation states that in these cases "every entry in classinfo will be checked", but it doesn't explain if the check is AND (all) or OR (any). In contrast, the documentation of isinstance is clear: "return True if object is an instance of *any* of the types".
Here's a possible rewriting that reduces the odds of incorrect interpretations, based on the text of isinstance:
ORIGINAL: "in which case every entry in classinfo will be checked"
PROPOSAL: "in which case return True if class is a subclass of any entry in classinfo"
4 remaining items
ambv commentedon Aug 31, 2021
New changeset 08767c7 by Zack Kneupper in branch 'main':
bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193)
08767c7
miss-islington commentedon Aug 31, 2021
New changeset ab8fed8 by Miss Islington (bot) in branch '3.10':
bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193)
ab8fed8
ambv commentedon Aug 31, 2021
New changeset 5f66ad0 by Łukasz Langa in branch '3.9':
bpo-44135: Refine explanation of how passing tuples to issubclass() behaves (GH-26193) (GH-28094)
5f66ad0
ambv commentedon Aug 31, 2021
New changeset 9a7ec2f by Ken Jin in branch 'main':
bpo-44135: [docs] Fix inline markup (GH-28095)
9a7ec2f
miss-islington commentedon Aug 31, 2021
New changeset 8711b3d by Miss Islington (bot) in branch '3.10':
bpo-44135: [docs] Fix inline markup (GH-28095)
8711b3d