The Wayback Machine - https://web.archive.org/web/20220203064054/https://github.com/python/cpython/pull/27815
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

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

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

@miss-islington
Copy link
Contributor Author

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

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

1 similar comment
@miss-islington
Copy link
Contributor Author

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

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

@ambv ambv requested a review from pablogsal Aug 18, 2021
@ambv
Copy link
Contributor

@ambv 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
14 checks passed
@miss-islington miss-islington deleted the backport-a3a4d20-3.10 branch Aug 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants