Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 20 additions & 15 deletions Doc/library/typing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2849,6 +2849,9 @@ Functions and decorators
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

Expand Down Expand Up @@ -3648,18 +3651,20 @@ Certain features in ``typing`` are deprecated and may be removed in a future
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` |
+-------------------------------------+---------------+-------------------+----------------+
4 changes: 4 additions & 0 deletions Doc/whatsnew/3.13.rst
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ Deprecated
``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
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,7 +727,7 @@ def call_later(self, delay, callback, *args, context=None):
always relative to the current time.

Each callback will be called exactly once. If two callbacks
are scheduled for exactly the same time, it undefined which
are scheduled for exactly the same time, it is undefined which
will be called first.

Any positional arguments after the callback will be passed to
Expand Down
2 changes: 1 addition & 1 deletion Lib/asyncio/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ class AbstractEventLoopPolicy:
def get_event_loop(self):
"""Get the event loop for the current context.

Returns an event loop object implementing the BaseEventLoop interface,
Returns an event loop object implementing the AbstractEventLoop interface,
or raises an exception in case no event loop has been set for the
current context and the current policy does not specify to create one.

Expand Down
12 changes: 8 additions & 4 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5794,10 +5794,14 @@ class F:
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')

Expand Down
2 changes: 2 additions & 0 deletions Lib/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2395,6 +2395,8 @@ def no_type_check_decorator(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)
Expand Down
1 change: 1 addition & 0 deletions Misc/ACKS
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ Erik Bray
Brian Brazil
Demian Brecht
Dave Brennan
Christopher Richard James Brett
Tom Bridgman
Anthony Briggs
Keith Briggs
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Deprecate :func:`typing.no_type_check_decorator`. No major type checker ever
added support for this decorator. Patch by Alex Waygood.