Problems caused by isinstance(list[int], type) returning True

serhiy-storchaka · GitHub

BPO

45665

Nosy

@gvanrossum

,

@serhiy-storchaka

,

@wyfo

,

@Fidget-Spinner

,

@AlexWaygood

,

@martinitus

Dependencies

bpo-40296

: help(list[int]) fails

bpo-45438

: inspect not capturing type annotations created by class_getitem

bpo-45662

: Incorrect repr of InitVar of a type alias

bpo-45663

: is_dataclass() does not work for dataclasses which are subclasses of types.GenericAlias

bpo-45664

: resolve_bases() and new_class() do not work with type alias of a built-in type

bpo-46032

: functools' singledispatch does not support GenericAlias

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more detailsGitHub fields:

assignee=Noneclosed_at=Nonecreated_at=<Date2021-10-29.08:27:43.950>labels= ['type-bug', 'library', '3.9', '3.10', '3.11'] title='Problems caused by isinstance(list[int], type) returning True'updated_at=<Date2022-01-06.16:58:47.655>user='https://github.com/serhiy-storchaka'bugs.python.org fields:

activity=<Date2022-01-06.16:58:47.655>actor='AlexWaygood'assignee='none'closed=Falseclosed_date=Nonecloser=Nonecomponents= ['Library (Lib)'] creation=<Date2021-10-29.08:27:43.950>creator='serhiy.storchaka'dependencies= ['40296', '45438', '45662', '45663', '45664', '46032'] files= [] hgrepos= [] issue_num=45665keywords= [] message_count=17.0messages= ['405290', '405291', '405427', '405429', '408207', '409167', '409233', '409679', '409691', '409694', '409697', '409701', '409702', '409703', '409711', '409792', '409881'] nosy_count=6.0nosy_names= ['gvanrossum', 'serhiy.storchaka', 'joperez', 'kj', 'AlexWaygood', 'martinitus'] pr_nums= [] priority='normal'resolution=Nonestage=Nonestatus='open'superseder=Nonetype='behavior'url='https://bugs.python.org/issue45665'versions= ['Python 3.9', 'Python 3.10', 'Python 3.11']

help(list[int]) fails #84476

inspect not capturing type annotations created by __class_getitem__ #89601

Incorrect repr of InitVar of a type alias #89825

is_dataclass() does not work for dataclasses which are subclasses of types.GenericAlias #89826

resolve_bases() and new_class() do not work with type alias of a built-in type #89827

functools' singledispatch does not support GenericAlias #90190

Enum does not work if member is an instance of types.GenericAlias #93847