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
144 changes: 52 additions & 92 deletions stdlib/argparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -91,40 +91,27 @@ class _ActionsContainer:
version: str = ...,
**kwargs: Any,
) -> Action: ...
if sys.version_info >= (3, 14):
@overload
def add_argument_group(
self,
title: str | None = None,
description: str | None = None,
*,
# argument_default's type must be valid for the arguments in the group
argument_default: Any = ...,
conflict_handler: str = ...,
) -> _ArgumentGroup: ...
@overload
@deprecated("The `prefix_chars` parameter deprecated since Python 3.14.")
def add_argument_group(
self,
title: str | None = None,
description: str | None = None,
*,
prefix_chars: str,
argument_default: Any = ...,
conflict_handler: str = ...,
) -> _ArgumentGroup: ...
else:
def add_argument_group(
self,
title: str | None = None,
description: str | None = None,
*,
prefix_chars: str = ...,
# argument_default's type must be valid for the arguments in the group
argument_default: Any = ...,
conflict_handler: str = ...,
) -> _ArgumentGroup: ...

@overload
def add_argument_group(
self,
title: str | None = None,
description: str | None = None,
*,
# argument_default's type must be valid for the arguments in the group
argument_default: Any = ...,
conflict_handler: str = ...,
) -> _ArgumentGroup: ...
@overload
@deprecated("The `prefix_chars` parameter deprecated since Python 3.14.")
def add_argument_group(
self,
title: str | None = None,
description: str | None = None,
*,
prefix_chars: str,
argument_default: Any = ...,
conflict_handler: str = ...,
) -> _ArgumentGroup: ...
def add_mutually_exclusive_group(self, *, required: bool = False) -> _MutuallyExclusiveGroup: ...
def _add_action(self, action: _ActionT) -> _ActionT: ...
def _remove_action(self, action: Action) -> None: ...
Expand Down Expand Up @@ -535,69 +522,42 @@ class Namespace(_AttributeHolder):
def __eq__(self, other: object) -> bool: ...
__hash__: ClassVar[None] # type: ignore[assignment]

if sys.version_info >= (3, 14):
@deprecated("Deprecated since Python 3.14. Open files after parsing arguments instead.")
class FileType:
# undocumented
_mode: str
_bufsize: int
_encoding: str | None
_errors: str | None
def __init__(
self, mode: str = "r", bufsize: int = -1, encoding: str | None = None, errors: str | None = None
) -> None: ...
def __call__(self, string: str) -> IO[Any]: ...

else:
class FileType:
# undocumented
_mode: str
_bufsize: int
_encoding: str | None
_errors: str | None
def __init__(
self, mode: str = "r", bufsize: int = -1, encoding: str | None = None, errors: str | None = None
) -> None: ...
def __call__(self, string: str) -> IO[Any]: ...
@deprecated("Deprecated since Python 3.14. Open files after parsing arguments instead.")
class FileType:
# undocumented
_mode: str
_bufsize: int
_encoding: str | None
_errors: str | None
def __init__(self, mode: str = "r", bufsize: int = -1, encoding: str | None = None, errors: str | None = None) -> None: ...
def __call__(self, string: str) -> IO[Any]: ...

# undocumented
class _ArgumentGroup(_ActionsContainer):
title: str | None
_group_actions: list[Action]
if sys.version_info >= (3, 14):
@overload
def __init__(
self,
container: _ActionsContainer,
title: str | None = None,
description: str | None = None,
*,
argument_default: Any = ...,
conflict_handler: str = ...,
) -> None: ...
@overload
@deprecated("Undocumented `prefix_chars` parameter is deprecated since Python 3.14.")
def __init__(
self,
container: _ActionsContainer,
title: str | None = None,
description: str | None = None,
*,
prefix_chars: str,
argument_default: Any = ...,
conflict_handler: str = ...,
) -> None: ...
else:
def __init__(
self,
container: _ActionsContainer,
title: str | None = None,
description: str | None = None,
*,
prefix_chars: str = ...,
argument_default: Any = ...,
conflict_handler: str = ...,
) -> None: ...
@overload
def __init__(
self,
container: _ActionsContainer,
title: str | None = None,
description: str | None = None,
*,
argument_default: Any = ...,
conflict_handler: str = ...,
) -> None: ...
@overload
@deprecated("Undocumented `prefix_chars` parameter is deprecated since Python 3.14.")
def __init__(
self,
container: _ActionsContainer,
title: str | None = None,
description: str | None = None,
*,
prefix_chars: str,
argument_default: Any = ...,
conflict_handler: str = ...,
) -> None: ...

# undocumented
class _MutuallyExclusiveGroup(_ArgumentGroup):
Expand Down
43 changes: 14 additions & 29 deletions stdlib/asyncio/events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -631,18 +631,12 @@ else:
@abstractmethod
def new_event_loop(self) -> AbstractEventLoop: ...
# Child processes handling (Unix only).
if sys.version_info >= (3, 12):
@abstractmethod
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def get_child_watcher(self) -> AbstractChildWatcher: ...
@abstractmethod
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
else:
@abstractmethod
def get_child_watcher(self) -> AbstractChildWatcher: ...
@abstractmethod
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...
@abstractmethod
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def get_child_watcher(self) -> AbstractChildWatcher: ...
@abstractmethod
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def set_child_watcher(self, watcher: AbstractChildWatcher) -> None: ...

AbstractEventLoopPolicy = _AbstractEventLoopPolicy

Expand All @@ -661,25 +655,16 @@ else:
if sys.version_info >= (3, 14):
def _get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
def _set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...
@deprecated("Deprecated since Python 3.14; will be removed in Python 3.16.")
def get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
@deprecated("Deprecated since Python 3.14; will be removed in Python 3.16.")
def set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...

else:
def get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
def set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...

@deprecated("Deprecated since Python 3.14; will be removed in Python 3.16.")
def get_event_loop_policy() -> _AbstractEventLoopPolicy: ...
@deprecated("Deprecated since Python 3.14; will be removed in Python 3.16.")
def set_event_loop_policy(policy: _AbstractEventLoopPolicy | None) -> None: ...
def set_event_loop(loop: AbstractEventLoop | None) -> None: ...
def new_event_loop() -> AbstractEventLoop: ...

if sys.version_info < (3, 14):
if sys.version_info >= (3, 12):
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def get_child_watcher() -> AbstractChildWatcher: ...
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...

else:
def get_child_watcher() -> AbstractChildWatcher: ...
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def get_child_watcher() -> AbstractChildWatcher: ...
@deprecated("Deprecated since Python 3.12; removed in Python 3.14.")
def set_child_watcher(watcher: AbstractChildWatcher) -> None: ...
14 changes: 4 additions & 10 deletions stdlib/ctypes/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,10 @@ def create_string_buffer(init: int | bytes, size: int | None = None) -> Array[c_
c_buffer = create_string_buffer

def create_unicode_buffer(init: int | str, size: int | None = None) -> Array[c_wchar]: ...

if sys.version_info >= (3, 13):
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...
@deprecated("Soft deprecated since Python 3.13. Use multiplication instead.")
def ARRAY(typ: _CT, len: int) -> Array[_CT]: ...

else:
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...
def ARRAY(typ: _CT, len: int) -> Array[_CT]: ...
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
def SetPointerType(pointer: type[_Pointer[Any]], cls: _CTypeBaseType) -> None: ...
@deprecated("Soft deprecated since Python 3.13. Use multiplication instead.")
def ARRAY(typ: _CT, len: int) -> Array[_CT]: ...

if sys.platform == "win32":
def DllCanUnloadNow() -> int: ...
Expand Down
30 changes: 9 additions & 21 deletions stdlib/http/server.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,12 @@ class SimpleHTTPRequestHandler(BaseHTTPRequestHandler):
def guess_type(self, path: StrPath) -> str: ... # undocumented

def executable(path: StrPath) -> bool: ... # undocumented

if sys.version_info >= (3, 13):
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
cgi_directories: list[str]
have_fork: bool # undocumented
def do_POST(self) -> None: ...
def is_cgi(self) -> bool: ... # undocumented
def is_executable(self, path: StrPath) -> bool: ... # undocumented
def is_python(self, path: StrPath) -> bool: ... # undocumented
def run_cgi(self) -> None: ... # undocumented

else:
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
cgi_directories: list[str]
have_fork: bool # undocumented
def do_POST(self) -> None: ...
def is_cgi(self) -> bool: ... # undocumented
def is_executable(self, path: StrPath) -> bool: ... # undocumented
def is_python(self, path: StrPath) -> bool: ... # undocumented
def run_cgi(self) -> None: ... # undocumented
@deprecated("Deprecated since Python 3.13; will be removed in Python 3.15.")
class CGIHTTPRequestHandler(SimpleHTTPRequestHandler):
cgi_directories: list[str]
have_fork: bool # undocumented
def do_POST(self) -> None: ...
def is_cgi(self) -> bool: ... # undocumented
def is_executable(self, path: StrPath) -> bool: ... # undocumented
def is_python(self, path: StrPath) -> bool: ... # undocumented
def run_cgi(self) -> None: ... # undocumented
7 changes: 2 additions & 5 deletions stdlib/importlib/resources/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,8 @@ else:
def read_text(package: Package, resource: Resource, encoding: str = "utf-8", errors: str = "strict") -> str: ...
def path(package: Package, resource: Resource) -> AbstractContextManager[Path, Literal[False]]: ...
def is_resource(package: Package, name: str) -> bool: ...
if sys.version_info >= (3, 11):
@deprecated("Deprecated since Python 3.11. Use `files(anchor).iterdir()`.")
def contents(package: Package) -> Iterator[str]: ...
else:
def contents(package: Package) -> Iterator[str]: ...
@deprecated("Deprecated since Python 3.11. Use `files(anchor).iterdir()`.")
def contents(package: Package) -> Iterator[str]: ...

if sys.version_info >= (3, 11):
from importlib.resources._common import as_file as as_file
Expand Down
7 changes: 2 additions & 5 deletions stdlib/locale.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,8 @@ def getpreferredencoding(do_setlocale: bool = True) -> _str: ...
def normalize(localename: _str) -> _str: ...

if sys.version_info < (3, 13):
if sys.version_info >= (3, 11):
@deprecated("Deprecated since Python 3.11; removed in Python 3.13. Use `locale.setlocale(locale.LC_ALL, '')` instead.")
def resetlocale(category: int = ...) -> None: ...
else:
def resetlocale(category: int = ...) -> None: ...
@deprecated("Deprecated since Python 3.11; removed in Python 3.13. Use `locale.setlocale(locale.LC_ALL, '')` instead.")
def resetlocale(category: int = ...) -> None: ...

if sys.version_info < (3, 12):
@deprecated("Deprecated since Python 3.7; removed in Python 3.12. Use `locale.format_string()` instead.")
Expand Down
14 changes: 4 additions & 10 deletions stdlib/nturl2path.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import sys
from typing_extensions import deprecated

if sys.version_info >= (3, 14):
@deprecated("The `nturl2path` module is deprecated since Python 3.14.")
def url2pathname(url: str) -> str: ...
@deprecated("The `nturl2path` module is deprecated since Python 3.14.")
def pathname2url(p: str) -> str: ...

else:
def url2pathname(url: str) -> str: ...
def pathname2url(p: str) -> str: ...
@deprecated("The `nturl2path` module is deprecated since Python 3.14.")
def url2pathname(url: str) -> str: ...
@deprecated("The `nturl2path` module is deprecated since Python 3.14.")
def pathname2url(p: str) -> str: ...
Loading
Loading