Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
try:
set_name = task.set_name
except AttributeError:
- pass
+ warnings.warn("Task.set_name() was added in Python 3.8, "
+ "the method support will be mandatory for third-party "
+ "task implementations since 3.13.",
+ DeprecationWarning, stacklevel=3)
else:
set_name(name)
import textwrap
import traceback
import unittest
-import weakref
from unittest import mock
from types import GenericAlias
--- /dev/null
+Deprecate missing :meth:`asyncio.Task.set_name` for third-party task
+implementations, schedule making it mandatory in Python 3.13.