This wraps the decorator with something that wraps the decorated
function in :func:`no_type_check`.
+ .. deprecated-removed:: 3.13 3.15
+ No type checker ever added support for ``@no_type_check_decorator``. It
+ is therefore deprecated, and will be removed in Python 3.15.
.. decorator:: override
version of Python. The following table summarizes major deprecations for your
convenience. This is subject to change, and not all deprecations are listed.
-+----------------------------------+---------------+-------------------+----------------+
-| Feature | Deprecated in | Projected removal | PEP/issue |
-+==================================+===============+===================+================+
-| ``typing`` versions of standard | 3.9 | Undecided | :pep:`585` |
-| collections | | | |
-+----------------------------------+---------------+-------------------+----------------+
-| ``typing.ByteString`` | 3.9 | 3.14 | :gh:`91896` |
-+----------------------------------+---------------+-------------------+----------------+
-| ``typing.Text`` | 3.11 | Undecided | :gh:`92332` |
-+----------------------------------+---------------+-------------------+----------------+
-| ``typing.Hashable`` and | 3.12 | Undecided | :gh:`94309` |
-| ``typing.Sized`` | | | |
-+----------------------------------+---------------+-------------------+----------------+
-| ``typing.TypeAlias`` | 3.12 | Undecided | :pep:`695` |
-+----------------------------------+---------------+-------------------+----------------+
++-------------------------------------+---------------+-------------------+----------------+
+| Feature | Deprecated in | Projected removal | PEP/issue |
++=====================================+===============+===================+================+
+| ``typing`` versions of standard | 3.9 | Undecided | :pep:`585` |
+| collections | | | |
++-------------------------------------+---------------+-------------------+----------------+
+| ``typing.ByteString`` | 3.9 | 3.14 | :gh:`91896` |
++-------------------------------------+---------------+-------------------+----------------+
+| ``typing.Text`` | 3.11 | Undecided | :gh:`92332` |
++-------------------------------------+---------------+-------------------+----------------+
+| ``typing.Hashable`` and | 3.12 | Undecided | :gh:`94309` |
+| ``typing.Sized`` | | | |
++-------------------------------------+---------------+-------------------+----------------+
+| ``typing.TypeAlias`` | 3.12 | Undecided | :pep:`695` |
++-------------------------------------+---------------+-------------------+----------------+
+| ``typing.no_type_check_decorator`` | 3.13 | 3.15 | :gh:`106309` |
++-------------------------------------+---------------+-------------------+----------------+
``NT = NamedTuple("NT", [])``. To create a TypedDict class with 0 fields, use
``class TD(TypedDict): pass`` or ``TD = TypedDict("TD", {})``.
(Contributed by Alex Waygood in :gh:`105566` and :gh:`105570`.)
+* :func:`typing.no_type_check_decorator` is deprecated, and scheduled for
+ removal in Python 3.15. After eight years in the :mod:`typing` module, it
+ has yet to be supported by any major type checkers.
+ (Contributed by Alex Waygood in :gh:`106309`.)
* :mod:`array`'s ``'u'`` format code, deprecated in docs since Python 3.3,
emits :exc:`DeprecationWarning` since 3.13
get_type_hints(clazz)
def test_meta_no_type_check(self):
-
- @no_type_check_decorator
- def magic_decorator(func):
- return func
+ depr_msg = (
+ "'typing.no_type_check_decorator' is deprecated "
+ "and slated for removal in Python 3.15"
+ )
+ with self.assertWarnsRegex(DeprecationWarning, depr_msg):
+ @no_type_check_decorator
+ def magic_decorator(func):
+ return func
self.assertEqual(magic_decorator.__name__, 'magic_decorator')
This wraps the decorator with something that wraps the decorated
function in @no_type_check.
"""
+ import warnings
+ warnings._deprecated("typing.no_type_check_decorator", remove=(3, 15))
@functools.wraps(decorator)
def wrapped_decorator(*args, **kwds):
func = decorator(*args, **kwds)