bpo-46998: Allow subclassing Any at runtime (GH-31841)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Shantanu 2022-04-04 19:35:29 -07:00 committed by GitHub
parent bb86d1d9fb
commit 5a4973e29f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 44 additions and 31 deletions

View file

@ -580,6 +580,11 @@ These can be used as types in annotations and do not support ``[]``.
* Every type is compatible with :data:`Any`.
* :data:`Any` is compatible with every type.
.. versionchanged:: 3.11
:data:`Any` can now 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.
.. data:: Never
The `bottom type <https://en.wikipedia.org/wiki/Bottom_type>`_,