classification
Title: Indexing the union type can return NotImplemented
Type: behavior Stage: resolved
Components: Interpreter Core Versions: Python 3.11, Python 3.10
process
Status: closed Resolution: fixed
Dependencies: 44632 Superseder:
Assigned To: Nosy List: gvanrossum, kj, miss-islington, serhiy.storchaka, uriyyo
Priority: normal Keywords: patch

Created on 2021-07-14 05:42 by serhiy.storchaka, last changed 2021-07-18 13:01 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 27218 merged serhiy.storchaka, 2021-07-17 18:08
PR 27224 merged miss-islington, 2021-07-18 09:10
Messages (4)
msg397468 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-14 05:42
>>> import typing
>>> (int | typing.T)[1]
NotImplemented

It is related to issue44632.
msg397625 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-16 13:33
Expected raising a TypeError.
msg397744 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-18 09:10
New changeset 3ea5332a4365bdd771286b3e9692495116e9ceef by Serhiy Storchaka in branch 'main':
bpo-44633: Fix parameter substitution of the union type with wrong types. (GH-27218)
https://github.com/python/cpython/commit/3ea5332a4365bdd771286b3e9692495116e9ceef
msg397746 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2021-07-18 11:59
New changeset 85b58292cf94de74d028053ac33a65f269f305cb by Miss Islington (bot) in branch '3.10':
bpo-44633: Fix parameter substitution of the union type with wrong types. (GH-27218) (GH-27224)
https://github.com/python/cpython/commit/85b58292cf94de74d028053ac33a65f269f305cb
History
Date User Action Args
2021-07-18 13:01:37serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2021-07-18 11:59:54serhiy.storchakasetmessages: + msg397746
2021-07-18 09:10:28miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request25765
2021-07-18 09:10:23serhiy.storchakasetmessages: + msg397744
2021-07-17 18:08:34serhiy.storchakasetpull_requests: - pull_request25756
2021-07-17 18:08:00serhiy.storchakasetpull_requests: + pull_request25759
2021-07-17 15:16:33uriyyosetpull_requests: + pull_request25756
2021-07-17 07:02:40serhiy.storchakasetpull_requests: - pull_request25744
2021-07-17 07:01:36uriyyosetkeywords: + patch
nosy: + uriyyo

pull_requests: + pull_request25744
stage: patch review
2021-07-16 13:33:06serhiy.storchakasetmessages: + msg397625
2021-07-14 11:05:35serhiy.storchakasetdependencies: + Union with TypeVar does not work as intended
2021-07-14 05:42:46serhiy.storchakacreate