mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-46998: Allow subclassing Any at runtime (GH-31841)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
bb86d1d9fb
commit
5a4973e29f
6 changed files with 44 additions and 31 deletions
|
@ -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>`_,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue