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
38 changes: 0 additions & 38 deletions stdlib/@tests/stubtest_allowlists/py315.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,19 +60,6 @@ annotationlib.ForwardRef.__resolved_str__
annotationlib.ForwardRef.__resolved_str_cache__
annotationlib.ForwardRef.__slots__
annotationlib.ForwardRef.__stringifier_dict__
argparse.ArgumentParser.__init__
argparse.ArgumentParser._get_formatter
argparse.ArgumentParser.format_help
argparse.ArgumentParser.format_usage
argparse.HelpFormatter.__init__
array.typecodes
ast.DictComp.value
ast.Import.__match_args__
ast.Import.is_lazy
ast.ImportFrom.__match_args__
ast.ImportFrom.is_lazy
ast.dump
ast.parse
ast.type_param.__init__
base64.a85decode
base64.b16decode
Expand Down Expand Up @@ -258,16 +245,6 @@ profiling.sampling.string_table
profiling.tracing
pydoc.Doc.STDLIB_DIR
pydoc.Doc.getdocloc
re.Pattern.prefixmatch
re.__all__
re.prefixmatch
shelve.BsdDbShelf.__init__
shelve.DbfilenameShelf.__init__
shelve.Shelf.__init__
shelve.Shelf.reorganize
shelve.ShelveError
shelve.__all__
shelve.open
site.addsitedir
site.addsitepackages
site.addusersitepackages
Expand All @@ -291,7 +268,6 @@ sys.last_exc
sys.lazy_modules
sys.set_lazy_imports
sys.set_lazy_imports_filter
tarfile.TarFile.__init__
threading.Condition.locked
threading.__all__
threading.concurrent_tee
Expand Down Expand Up @@ -341,8 +317,6 @@ typing.Union
typing._SpecialForm.__mro_entries__
typing_extensions.__all__
typing_extensions.Protocol
unittest._log._AssertLogsContext.__init__
unittest.case.TestCase.assertLogs
urllib.parse._DefragResultBase.geturl
urllib.parse._ParseResultBase.geturl
urllib.parse._SplitResultBase.geturl
Expand All @@ -351,18 +325,6 @@ urllib.parse.urlparse
urllib.parse.urlsplit
urllib.parse.urlunparse
urllib.parse.urlunsplit
warnings.WarningMessage.__init__
wave.WAVE_FORMAT_EXTENSIBLE
wave.WAVE_FORMAT_IEEE_FLOAT
wave.Wave_read.getformat
wave.Wave_read.getmark
wave.Wave_read.getmarkers
wave.Wave_write.getformat
wave.Wave_write.getmark
wave.Wave_write.getmarkers
wave.Wave_write.setformat
wave.Wave_write.setmark
wave.__all__
xml.etree.ElementTree.__all__
xml.is_valid_name
xml.utils
Expand Down
46 changes: 41 additions & 5 deletions stdlib/argparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,28 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
_subparsers: _ArgumentGroup | None

# Note: the constructor arguments are also used in _SubParsersAction.add_parser.
if sys.version_info >= (3, 14):
if sys.version_info >= (3, 15):
def __init__(
self,
prog: str | None = None,
usage: str | None = None,
description: str | None = None,
epilog: str | None = None,
parents: Iterable[ArgumentParser] = [],
formatter_class: _FormatterClass = ...,
prefix_chars: str = "-",
fromfile_prefix_chars: str | None = None,
argument_default: Any = None,
conflict_handler: str = "error",
add_help: bool = True,
allow_abbrev: bool = True,
exit_on_error: bool = True,
*,
suggest_on_error: bool = True,
color: bool = True,
) -> None: ...

elif sys.version_info >= (3, 14):
def __init__(
self,
prog: str | None = None,
Expand Down Expand Up @@ -236,8 +257,14 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
) -> _SubParsersAction[_ArgumentParserT]: ...
def print_usage(self, file: SupportsWrite[str] | None = None) -> None: ...
def print_help(self, file: SupportsWrite[str] | None = None) -> None: ...
def format_usage(self) -> str: ...
def format_help(self) -> str: ...
if sys.version_info >= (3, 15):
def format_usage(self, formatter: HelpFormatter | None = None) -> str: ...
def format_help(self, formatter: HelpFormatter | None = None) -> str: ...

else:
def format_usage(self) -> str: ...
def format_help(self) -> str: ...

@overload
def parse_known_args(self, args: Iterable[str] | None = None, namespace: None = None) -> tuple[Namespace, list[str]]: ...
@overload
Expand Down Expand Up @@ -284,7 +311,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
def _get_values(self, action: Action, arg_strings: list[str]) -> Any: ...
def _get_value(self, action: Action, arg_string: str) -> Any: ...
def _check_value(self, action: Action, value: Any) -> None: ...
def _get_formatter(self) -> HelpFormatter: ...
if sys.version_info >= (3, 15):
def _get_formatter(self, file: SupportsWrite[str] | None = None) -> HelpFormatter: ...
else:
def _get_formatter(self) -> HelpFormatter: ...

def _print_message(self, message: str, file: SupportsWrite[str] | None = None) -> None: ...

class HelpFormatter:
Expand All @@ -309,7 +340,12 @@ class HelpFormatter:
def __init__(self, formatter: HelpFormatter, parent: Self | None, heading: str | None = None) -> None: ...
def format_help(self) -> str: ...

if sys.version_info >= (3, 14):
if sys.version_info >= (3, 15):
def __init__(
self, prog: str, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None
) -> None: ...

elif sys.version_info >= (3, 14):
def __init__(
self, prog: str, indent_increment: int = 2, max_help_position: int = 24, width: int | None = None, color: bool = True
) -> None: ...
Expand Down
10 changes: 8 additions & 2 deletions stdlib/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ from typing import Any, ClassVar, Literal, SupportsIndex, TypeAlias, TypeVar, ov
from typing_extensions import Self, deprecated, disjoint_base

_IntTypeCode: TypeAlias = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
_FloatTypeCode: TypeAlias = Literal["f", "d"]
if sys.version_info >= (3, 15):
_FloatTypeCode: TypeAlias = Literal["f", "d", "e", "Zf", "Zd"]
else:
_FloatTypeCode: TypeAlias = Literal["f", "d"]
if sys.version_info >= (3, 13):
_UnicodeTypeCode: TypeAlias = Literal["u", "w"]
else:
Expand All @@ -15,7 +18,10 @@ _TypeCode: TypeAlias = _IntTypeCode | _FloatTypeCode | _UnicodeTypeCode

_T = TypeVar("_T", int, float, str)

typecodes: str
if sys.version_info >= (3, 15):
typecodes: tuple[str, ...]
else:
typecodes: str

@disjoint_base
class array(MutableSequence[_T]):
Expand Down
173 changes: 164 additions & 9 deletions stdlib/ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -710,22 +710,54 @@ class Assert(stmt):
def __replace__(self, *, test: expr = ..., msg: expr | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ...

class Import(stmt):
__match_args__ = ("names",)
if sys.version_info >= (3, 15):
__match_args__ = ("names", "is_lazy")
else:
__match_args__ = ("names",)
names: list[alias]
if sys.version_info >= (3, 13):
if sys.version_info >= (3, 15):
is_lazy: bool | None
if sys.version_info >= (3, 15):
def __init__(self, names: list[alias] = ..., is_lazy: bool | None = None, **kwargs: Unpack[_Attributes]) -> None: ...

elif sys.version_info >= (3, 13):
def __init__(self, names: list[alias] = ..., **kwargs: Unpack[_Attributes]) -> None: ...
else:
def __init__(self, names: list[alias], **kwargs: Unpack[_Attributes]) -> None: ...

if sys.version_info >= (3, 14):
if sys.version_info >= (3, 15):
def __replace__(self, *, names: list[alias] = ..., is_lazy: bool | None = ..., **kwargs: Unpack[_Attributes]) -> Self: ...

elif sys.version_info >= (3, 14):
def __replace__(self, *, names: list[alias] = ..., **kwargs: Unpack[_Attributes]) -> Self: ...

class ImportFrom(stmt):
__match_args__ = ("module", "names", "level")
if sys.version_info >= (3, 15):
__match_args__ = ("module", "names", "level", "is_lazy")
else:
__match_args__ = ("module", "names", "level")
module: str | None
names: list[alias]
level: int
if sys.version_info >= (3, 13):
if sys.version_info >= (3, 15):
is_lazy: bool | None
if sys.version_info >= (3, 15):
@overload
def __init__(
self, module: str | None, names: list[alias], level: int, is_lazy: bool | None = None, **kwargs: Unpack[_Attributes]
) -> None: ...
@overload
def __init__(
self,
module: str | None = None,
names: list[alias] = ...,
*,
level: int,
is_lazy: bool | None = None,
**kwargs: Unpack[_Attributes],
) -> None: ...

elif sys.version_info >= (3, 13):
@overload
def __init__(self, module: str | None, names: list[alias], level: int, **kwargs: Unpack[_Attributes]) -> None: ...
@overload
Expand All @@ -740,7 +772,18 @@ class ImportFrom(stmt):
self, module: str | None = None, *, names: list[alias], level: int, **kwargs: Unpack[_Attributes]
) -> None: ...

if sys.version_info >= (3, 14):
if sys.version_info >= (3, 15):
def __replace__(
self,
*,
module: str | None = ...,
names: list[alias] = ...,
level: int = ...,
is_lazy: bool | None = ...,
**kwargs: Unpack[_Attributes],
) -> Self: ...

elif sys.version_info >= (3, 14):
def __replace__(
self, *, module: str | None = ..., names: list[alias] = ..., level: int = ..., **kwargs: Unpack[_Attributes]
) -> Self: ...
Expand Down Expand Up @@ -908,7 +951,10 @@ class SetComp(expr):
class DictComp(expr):
__match_args__ = ("key", "value", "generators")
key: expr
value: expr
if sys.version_info >= (3, 15):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PEP 798

value: expr | None
else:
value: expr
generators: list[comprehension]
if sys.version_info >= (3, 13):
def __init__(
Expand Down Expand Up @@ -1672,7 +1718,105 @@ if sys.version_info < (3, 14):

_T = _TypeVar("_T", bound=AST)

if sys.version_info >= (3, 13):
if sys.version_info >= (3, 15):
@overload
def parse(
source: _T,
filename: str | bytes | os.PathLike[Any] = "<unknown>",
mode: Literal["exec", "eval", "func_type", "single"] = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> _T: ...
@overload
def parse(
source: str | ReadableBuffer,
filename: str | bytes | os.PathLike[Any] = "<unknown>",
mode: Literal["exec"] = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Module: ...
@overload
def parse(
source: str | ReadableBuffer,
filename: str | bytes | os.PathLike[Any],
mode: Literal["eval"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Expression: ...
@overload
def parse(
source: str | ReadableBuffer,
filename: str | bytes | os.PathLike[Any],
mode: Literal["func_type"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> FunctionType: ...
@overload
def parse(
source: str | ReadableBuffer,
filename: str | bytes | os.PathLike[Any],
mode: Literal["single"],
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Interactive: ...
@overload
def parse(
source: str | ReadableBuffer,
*,
mode: Literal["eval"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Expression: ...
@overload
def parse(
source: str | ReadableBuffer,
*,
mode: Literal["func_type"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> FunctionType: ...
@overload
def parse(
source: str | ReadableBuffer,
*,
mode: Literal["single"],
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> Interactive: ...
@overload
def parse(
source: str | ReadableBuffer,
filename: str | bytes | os.PathLike[Any] = "<unknown>",
mode: str = "exec",
*,
type_comments: bool = False,
feature_version: None | int | tuple[int, int] = None,
optimize: Literal[-1, 0, 1, 2] = -1,
module: str | None = None,
) -> mod: ...

elif sys.version_info >= (3, 13):
@overload
def parse(
source: _T,
Expand Down Expand Up @@ -1843,7 +1987,18 @@ else:

def literal_eval(node_or_string: str | AST) -> Any: ...

if sys.version_info >= (3, 13):
if sys.version_info >= (3, 15):
def dump(
node: AST,
annotate_fields: bool = True,
include_attributes: bool = False,
*,
indent: int | str | None = None,
show_empty: bool = False,
color: bool = False,
) -> str: ...

elif sys.version_info >= (3, 13):
def dump(
node: AST,
annotate_fields: bool = True,
Expand Down
Loading
Loading