gh-89828: Do not relay the __class__ attribute in GenericAlias by serhiy-storchaka · Pull Request #93754 · python/cpython
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
list[int].__class__ returned type, and isinstance(list[int], type) returned True. It caused numerous problems in code that checks isinstance(x, type).
miss-islington pushed a commit to miss-islington/cpython that referenced this issue
Jun 18, 2022…ythonGH-93754) list[int].__class__ returned type, and isinstance(list[int], type) returned True. It caused numerous problems in code that checks isinstance(x, type). (cherry picked from commit f9433ff) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington added a commit that referenced this issue
Jun 18, 2022) list[int].__class__ returned type, and isinstance(list[int], type) returned True. It caused numerous problems in code that checks isinstance(x, type). (cherry picked from commit f9433ff) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>