Uh oh!
There was an error while loading. Please reload this page.
Add 3.14 Deprecations - #14289
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| def as_posix(self) -> str: ... | ||
| def as_uri(self) -> str: ... | ||
| if sys.version_info >= (3, 14): | ||
| @deprecated("PurePath.as_uri() is deprecated. Use Path.as_uri() instead.") |
There was a problem hiding this comment.
That's confusing, it's the same method. Also, we don't have an override for Path.as_uri, so people will see this deprecation even if they call the method on a Path.
There was a problem hiding this comment.
Missed the fact that we didn't have an override: 7eccbac
There was a problem hiding this comment.
Yeah, the exact snippet from the release notes: pathlib.PurePath.as_uri() is deprecated and will be removed in Python 3.19. Use pathlib.Path.as_uri() instead
There was a problem hiding this comment.
You can also find a runtime warning: https://github.com/python/cpython/blob/e9b647dd30d22cef465972d898a34c4b1bb6615d/Lib/pathlib/__init__.py#L534
Uh oh!
There was an error while loading. Please reload this page.
srittau
commented
Jul 7, 2025
It seems that |
This comment has been minimized.
This comment has been minimized.
srittau
commented
Jul 7, 2025
@JelleZijlstra CI fails, at the moment, so we shouldn't merge. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
@JelleZijlstra@srittau I had to an ignore for |
srittau
left a comment
There was a problem hiding this comment.
Looks mostly good, a few final small suggestions below.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | ||
| def iscoroutinefunction(func: Callable[..., Coroutine[Any, Any, Any]]) -> bool: ... | ||
| @overload | ||
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | ||
| def iscoroutinefunction(func: Callable[_P, Awaitable[_T]]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, _T]]]: ... | ||
| @overload | ||
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") | ||
| def iscoroutinefunction(func: Callable[_P, object]) -> TypeGuard[Callable[_P, Coroutine[Any, Any, Any]]]: ... | ||
| @overload | ||
| @deprecated("Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead") |
There was a problem hiding this comment.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Avasam <samuel.06@hotmail.com>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
max-muoto
commented
Aug 4, 2025
Diff from mypy_primer, showing the effect of this PR on open source code: aiohttp (https://github.com/aio-libs/aiohttp)
+ aiohttp/worker.py:73:44: error: overload def (func: def (*Any, **Any) -> typing.Coroutine[Any, Any, Any]) -> builtins.bool of function asyncio.coroutines.iscoroutinefunction is deprecated: Deprecated in Python 3.14; use inspect.iscoroutinefunction() instead [deprecated]+ aiohttp/worker.py:73:44: note: See https://mypy.rtfd.io/en/stable/_refs.html#code-deprecated for more info [deprecated]
trio (https://github.com/python-trio/trio)
+ src/trio/_path.py:258: error: Argument 1 to "as_uri" of "Path" has incompatible type "trio._path.Path"; expected "pathlib.Path" [arg-type] |
Add the following deprecations for 3.14:
pathlib.PurePath.as_urideprecation.pdb.curframe_localsdeprecation.asyncio.iscoroutinefunctiondeprecation.codecs.opendeprecation.os.popenandos.spawn*function deprecations.