8000 bpo-46998: Allow subclassing Any at runtime by hauntsaninja · Pull Request #31841 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-46998: Allow subclassing Any at runtime #31841

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

Merged
merged 15 commits into from
Apr 5, 2022
Prev Previous commit
Next Next commit
cooperative inheritance
  • Loading branch information
hauntsaninja committed Mar 13, 2022
commit 1c1ab38de08ade0454e2dbb3338e84e57f779d95
2 changes: 1 addition & 1 deletion Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ class Any(metaclass=_AnyMeta):
def __new__(cls, *args, **kwargs):
if cls is Any:
raise TypeError("Any cannot be instantiated")
return object.__new__(cls, *args, **kwargs)
return super().__new__(cls, *args, **kwargs)


@_SpecialForm
Expand Down
0