Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3.10] bpo-44524: Fix cryptic TypeError message when trying to subclass special forms in typing (GH-27710) #27815

Merged
merged 1 commit into from
Aug 28, 2021

Conversation

miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Aug 18, 2021

This was a Python 3.9 regression.
(cherry picked from commit a3a4d20)

Co-authored-by: Yurii Karabas [email protected]

https://bugs.python.org/issue44524

…ial forms in `typing` (pythonGH-27710)

This was a Python 3.9 regression.
(cherry picked from commit a3a4d20)

Co-authored-by: Yurii Karabas <[email protected]>
@miss-islington
Copy link
Contributor Author

@uriyyo and @ambv: Status check is done, and it's a success ✅ .

@miss-islington
Copy link
Contributor Author

@uriyyo and @ambv: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington
Copy link
Contributor Author

@uriyyo and @ambv: Status check is done, and it's a success ✅ .

@ambv ambv requested a review from pablogsal August 18, 2021 19:33
@ambv
Copy link
Contributor

ambv commented Aug 18, 2021

@pablogsal, this is only a TypeError message improvement.

Before:

>>> class C(Union[int, str]): ...
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

After:

>>> class C(Union[int, str]): ...
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Cannot subclass <class 'typing._SpecialForm'>

The "after" was the situation before Python 3.9.0.

@miss-islington miss-islington merged commit 81fa08c into python:3.10 Aug 28, 2021
@miss-islington miss-islington deleted the backport-a3a4d20-3.10 branch August 28, 2021 18:09
@farcat farcat mannequin mentioned this pull request Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants