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

Clarify the implications of subclassing Any #1747

Closed
carljm opened this issue May 23, 2024 · 1 comment
Closed

Clarify the implications of subclassing Any #1747

carljm opened this issue May 23, 2024 · 1 comment
Labels
topic: typing spec For improving the typing spec

Comments

@carljm
Copy link
Member

carljm commented May 23, 2024

The typing spec says

Any can also be used as a base class. This can be useful for avoiding type checker errors with classes that can duck type anywhere or are highly dynamic.

But this leaves some cases unclear. The unclear cases are described in https://discuss.python.org/t/take-2-rules-for-subclassing-any/47981

One possible solution was explored in #1672, but rejected due to issues uncovered in https://discuss.python.org/t/take-2-rules-for-subclassing-any/47981/19

@JelleZijlstra JelleZijlstra added the topic: typing spec For improving the typing spec label May 23, 2024
@JelleZijlstra
Copy link
Member

Duplicate of #1546

@JelleZijlstra JelleZijlstra marked this as a duplicate of #1546 May 23, 2024
@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: typing spec For improving the typing spec
Projects
None yet
Development

No branches or pull requests

2 participants