diff --git a/crates/ty_ide/src/goto_type_definition.rs b/crates/ty_ide/src/goto_type_definition.rs index fe85f44095679..5964f241a4c59 100644 --- a/crates/ty_ide/src/goto_type_definition.rs +++ b/crates/ty_ide/src/goto_type_definition.rs @@ -145,14 +145,14 @@ mod tests { assert_snapshot!(test.goto_type_definition(), @r" info[goto-type-definition]: Type definition - --> stdlib/typing.pyi:770:1 + --> stdlib/typing.pyi:781:1 | - 768 | def __class_getitem__(cls, args: TypeVar | tuple[TypeVar, ...]) -> _Final: ... - 769 | - 770 | Generic: type[_Generic] + 779 | def __class_getitem__(cls, args: TypeVar | tuple[TypeVar, ...]) -> _Final: ... + 780 | + 781 | Generic: type[_Generic] | ^^^^^^^ - 771 | - 772 | class _ProtocolMeta(ABCMeta): + 782 | + 783 | class _ProtocolMeta(ABCMeta): | info: Source --> main.py:4:1 diff --git "a/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Syntax_(142fa2948c3c6cf1).snap" "b/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Syntax_(142fa2948c3c6cf1).snap" index 78cbed24b6c66..d8bf66cf9ea59 100644 --- "a/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Syntax_(142fa2948c3c6cf1).snap" +++ "b/crates/ty_python_semantic/resources/mdtest/snapshots/deprecated.md_-_Tests_for_the_`@depr\342\200\246_-_Syntax_(142fa2948c3c6cf1).snap" @@ -91,14 +91,14 @@ error[missing-argument]: No argument provided for required parameter `arg` of bo 7 | from typing_extensions import deprecated | info: Parameter declared here - --> stdlib/typing_extensions.pyi:1000:28 + --> stdlib/typing_extensions.pyi:1001:28 | - 998 | stacklevel: int - 999 | def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ... -1000 | def __call__(self, arg: _T, /) -> _T: ... + 999 | stacklevel: int +1000 | def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ... +1001 | def __call__(self, arg: _T, /) -> _T: ... | ^^^^^^^ -1001 | -1002 | @final +1002 | +1003 | @final | info: rule `missing-argument` is enabled by default diff --git a/crates/ty_vendored/vendor/typeshed/source_commit.txt b/crates/ty_vendored/vendor/typeshed/source_commit.txt index 7ce1784405936..fae00078a9314 100644 --- a/crates/ty_vendored/vendor/typeshed/source_commit.txt +++ b/crates/ty_vendored/vendor/typeshed/source_commit.txt @@ -1 +1 @@ -f8cdc0bd526301e873cd952eb0d457bdf2554e57 +ef2b90c67e5c668b91b3ae121baf00ee5165c30b diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/asyncio/runners.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/asyncio/runners.pyi index 25698e14a64e1..efc5eaac665ba 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/asyncio/runners.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/asyncio/runners.pyi @@ -1,6 +1,6 @@ import sys from _typeshed import Unused -from collections.abc import Callable, Coroutine +from collections.abc import Awaitable, Callable, Coroutine from contextvars import Context from typing import Any, TypeVar, final from typing_extensions import Self @@ -50,9 +50,12 @@ if sys.version_info >= (3, 11): def get_loop(self) -> AbstractEventLoop: """Return embedded event loop.""" - - def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: - """Run code in the embedded event loop.""" + if sys.version_info >= (3, 14): + def run(self, coro: Awaitable[_T], *, context: Context | None = None) -> _T: + """Run code in the embedded event loop.""" + else: + def run(self, coro: Coroutine[Any, Any, _T], *, context: Context | None = None) -> _T: + """Run a coroutine inside the embedded event loop.""" if sys.version_info >= (3, 12): def run( diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/asyncio/trsock.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/asyncio/trsock.pyi index 4d08d240165be..ebcd409057c23 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/asyncio/trsock.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/asyncio/trsock.pyi @@ -69,7 +69,7 @@ class TransportSocket: def listen(self, backlog: int = ..., /) -> None: ... @deprecated("Removed in Python 3.11") def makefile(self) -> BinaryIO: ... - @deprecated("Rmoved in Python 3.11") + @deprecated("Removed in Python 3.11") def sendfile(self, file: BinaryIO, offset: int = 0, count: int | None = None) -> int: ... @deprecated("Removed in Python 3.11") def close(self) -> None: ... diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/calendar.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/calendar.pyi index 3b2aa61ceb873..b0cda899d6996 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/calendar.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/calendar.pyi @@ -64,10 +64,12 @@ if sys.version_info >= (3, 12): _LocaleType: TypeAlias = tuple[str | None, str | None] -class IllegalMonthError(ValueError): +class IllegalMonthError(ValueError, IndexError): + month: int def __init__(self, month: int) -> None: ... class IllegalWeekdayError(ValueError): + weekday: int def __init__(self, weekday: int) -> None: ... def isleap(year: int) -> bool: diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/ipaddress.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/ipaddress.pyi index f8397ff5b33ed..eb6439f5ad516 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/ipaddress.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/ipaddress.pyi @@ -257,7 +257,7 @@ class _BaseNetwork(_IPAddressBase, Generic[_A]): """ - def hosts(self) -> Iterator[_A] | list[_A]: + def hosts(self) -> Iterator[_A]: """Generate Iterator over usable hosts in a network. This is like __iter__ except it doesn't return the network diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/mimetypes.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/mimetypes.pyi index 4e54a0eb8538f..0df876c5aaa18 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/mimetypes.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/mimetypes.pyi @@ -25,7 +25,7 @@ read_mime_types(file) -- parse one file, return a dictionary or None import sys from _typeshed import StrPath -from collections.abc import Sequence +from collections.abc import Iterable from typing import IO __all__ = [ @@ -93,8 +93,8 @@ def guess_extension(type: str, strict: bool = True) -> str | None: but non-standard types. """ -def init(files: Sequence[str] | None = None) -> None: ... -def read_mime_types(file: str) -> dict[str, str] | None: ... +def init(files: Iterable[StrPath] | None = None) -> None: ... +def read_mime_types(file: StrPath) -> dict[str, str] | None: ... def add_type(type: str, ext: str, strict: bool = True) -> None: """Add a mapping between a type and an extension. @@ -116,7 +116,7 @@ if sys.version_info >= (3, 13): """ inited: bool -knownfiles: list[str] +knownfiles: list[StrPath] suffix_map: dict[str, str] encodings_map: dict[str, str] types_map: dict[str, str] @@ -134,7 +134,7 @@ class MimeTypes: encodings_map: dict[str, str] types_map: tuple[dict[str, str], dict[str, str]] types_map_inv: tuple[dict[str, str], dict[str, str]] - def __init__(self, filenames: tuple[str, ...] = (), strict: bool = True) -> None: ... + def __init__(self, filenames: Iterable[StrPath] = (), strict: bool = True) -> None: ... def add_type(self, type: str, ext: str, strict: bool = True) -> None: """Add a mapping between a type and an extension. @@ -196,7 +196,7 @@ class MimeTypes: but non-standard types. """ - def read(self, filename: str, strict: bool = True) -> None: + def read(self, filename: StrPath, strict: bool = True) -> None: """ Read a single mime.types-format file, specified by pathname. diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/managers.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/managers.pyi index c4c8182c1ad27..082267fdadefa 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/managers.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/managers.pyi @@ -216,6 +216,8 @@ class BaseListProxy(BaseProxy, MutableSequence[_T]): def count(self, value: _T, /) -> int: ... def insert(self, index: SupportsIndex, object: _T, /) -> None: ... def remove(self, value: _T, /) -> None: ... + if sys.version_info >= (3, 14): + def copy(self) -> list[_T]: ... # Use BaseListProxy[SupportsRichComparisonT] for the first overload rather than [SupportsRichComparison] # to work around invariance @overload @@ -429,8 +431,9 @@ class SyncManager(BaseManager): def dict(self, iterable: Iterable[list[str]], /) -> DictProxy[str, str]: ... @overload def dict(self, iterable: Iterable[list[bytes]], /) -> DictProxy[bytes, bytes]: ... + # Overloads are copied from builtins.list.__init__ @overload - def list(self, sequence: Sequence[_T], /) -> ListProxy[_T]: ... + def list(self, iterable: Iterable[_T], /) -> ListProxy[_T]: ... @overload def list(self) -> ListProxy[Any]: ... if sys.version_info >= (3, 14): diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/process.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/process.pyi index f740eb50c0eb4..26307a7fe3881 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/process.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/process.pyi @@ -1,3 +1,4 @@ +import sys from collections.abc import Callable, Iterable, Mapping from typing import Any @@ -33,6 +34,11 @@ class BaseProcess: """ Start child process """ + if sys.version_info >= (3, 14): + def interrupt(self) -> None: + """ + Terminate process; sends SIGINT signal + """ def terminate(self) -> None: """ diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/synchronize.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/synchronize.pyi index a0d97baa0633b..541e0b05dd8a6 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/synchronize.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/multiprocessing/synchronize.pyi @@ -1,3 +1,4 @@ +import sys import threading from collections.abc import Callable from multiprocessing.context import BaseContext @@ -45,6 +46,8 @@ class SemLock: # These methods are copied from the wrapped _multiprocessing.SemLock object def acquire(self, block: bool = True, timeout: float | None = None) -> bool: ... def release(self) -> None: ... + if sys.version_info >= (3, 14): + def locked(self) -> bool: ... class Lock(SemLock): def __init__(self, *, ctx: BaseContext) -> None: ... diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/sqlite3/__init__.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/sqlite3/__init__.pyi index e378b4d434026..b57c0410dca3a 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/sqlite3/__init__.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/sqlite3/__init__.pyi @@ -256,6 +256,7 @@ _AdaptedInputData: TypeAlias = _SqliteData | Any _Parameters: TypeAlias = SupportsLenAndGetItem[_AdaptedInputData] | Mapping[str, _AdaptedInputData] # Controls the legacy transaction handling mode of sqlite3. _IsolationLevel: TypeAlias = Literal["DEFERRED", "EXCLUSIVE", "IMMEDIATE"] | None +_RowFactoryOptions: TypeAlias = type[Row] | Callable[[Cursor, Row], object] | None @type_check_only class _AnyParamWindowAggregateClass(Protocol): @@ -336,7 +337,7 @@ class Connection: def autocommit(self) -> int: ... @autocommit.setter def autocommit(self, val: int) -> None: ... - row_factory: Any + row_factory: _RowFactoryOptions text_factory: Any if sys.version_info >= (3, 12): def __init__( @@ -623,7 +624,7 @@ class Cursor: def description(self) -> tuple[tuple[str, None, None, None, None, None, None], ...] | MaybeNone: ... @property def lastrowid(self) -> int | None: ... - row_factory: Callable[[Cursor, Row], object] | None + row_factory: _RowFactoryOptions @property def rowcount(self) -> int: ... def __init__(self, cursor: Connection, /) -> None: ... diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/subprocess.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/subprocess.pyi index 60e4906577077..090c41209d125 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/subprocess.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/subprocess.pyi @@ -606,7 +606,6 @@ elif sys.version_info >= (3, 10): ) -> CompletedProcess[Any]: ... else: - # 3.9 adds arguments "user", "group", "extra_groups" and "umask" @overload def run( args: _CMD, diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/sys/__init__.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/sys/__init__.pyi index eef3dd37b5253..ee3a99be81edb 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/sys/__init__.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/sys/__init__.pyi @@ -77,7 +77,7 @@ from builtins import object as _object from collections.abc import AsyncGenerator, Callable, Sequence from io import TextIOWrapper from types import FrameType, ModuleType, TracebackType -from typing import Any, Final, Literal, NoReturn, Protocol, TextIO, TypeVar, final, type_check_only +from typing import Any, Final, Literal, NoReturn, Protocol, TextIO, TypeVar, final, overload, type_check_only from typing_extensions import LiteralString, TypeAlias, deprecated _T = TypeVar("_T") @@ -648,7 +648,7 @@ if sys.platform == "android": # noqa: Y008 def getallocatedblocks() -> int: """Return the number of memory blocks currently allocated.""" -def getdefaultencoding() -> str: +def getdefaultencoding() -> Literal["utf-8"]: """Return the current default encoding used by the Unicode implementation.""" if sys.platform != "win32": @@ -658,10 +658,10 @@ if sys.platform != "win32": The flag constants are defined in the os module. """ -def getfilesystemencoding() -> str: +def getfilesystemencoding() -> LiteralString: """Return the encoding used to convert Unicode filenames to OS filenames.""" -def getfilesystemencodeerrors() -> str: +def getfilesystemencodeerrors() -> LiteralString: """Return the error mode used Unicode to OS filename conversion.""" def getrefcount(object: Any, /) -> int: @@ -755,7 +755,8 @@ if sys.platform == "win32": intended for identifying the OS rather than feature detection. """ -def intern(string: str, /) -> str: +@overload +def intern(string: LiteralString, /) -> LiteralString: """``Intern'' the given string. This enters the string in the (global) table of interned strings whose @@ -763,6 +764,9 @@ def intern(string: str, /) -> str: the previously interned string object with the same value. """ +@overload +def intern(string: str, /) -> str: ... # type: ignore[misc] + __interactivehook__: Callable[[], object] if sys.version_info >= (3, 13): diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/threading.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/threading.pyi index 4a52cc05610e2..d043edc4a3bb9 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/threading.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/threading.pyi @@ -447,6 +447,9 @@ class Condition: ) -> None: ... def acquire(self, blocking: bool = True, timeout: float = -1) -> bool: ... def release(self) -> None: ... + if sys.version_info >= (3, 14): + def locked(self) -> bool: ... + def wait(self, timeout: float | None = None) -> bool: """Wait until notified or until a timeout occurs. diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/tkinter/constants.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/tkinter/constants.pyi index fbfe8b49b9979..eb1ef446cf227 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/tkinter/constants.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/tkinter/constants.pyi @@ -1,12 +1,12 @@ from typing import Final # These are not actually bools. See #4669 -NO: Final[bool] -YES: Final[bool] -TRUE: Final[bool] -FALSE: Final[bool] -ON: Final[bool] -OFF: Final[bool] +YES: Final = True +NO: Final = False +TRUE: Final = True +FALSE: Final = False +ON: Final = True +OFF: Final = False N: Final = "n" S: Final = "s" W: Final = "w" diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/typing.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/typing.pyi index 8daf975d2bb1b..4f7606bc9b079 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/typing.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/typing.pyi @@ -644,6 +644,7 @@ if sys.version_info >= (3, 10): def __or__(self, other: Any) -> _SpecialForm: ... def __ror__(self, other: Any) -> _SpecialForm: ... __supertype__: type | NewType + __name__: str else: def NewType(name: str, tp: Any) -> Any: @@ -722,12 +723,22 @@ def no_type_check(arg: _F) -> _F: This mutates the function(s) or class(es) in place. """ -def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: - """Decorator to give another decorator the @no_type_check effect. +if sys.version_info >= (3, 13): + @deprecated("Deprecated since Python 3.13; removed in Python 3.15.") + def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: + """Decorator to give another decorator the @no_type_check effect. - This wraps the decorator with something that wraps the decorated - function in @no_type_check. - """ + This wraps the decorator with something that wraps the decorated + function in @no_type_check. + """ + +else: + def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: + """Decorator to give another decorator the @no_type_check effect. + + This wraps the decorator with something that wraps the decorated + function in @no_type_check. + """ # This itself is only available during type checking def type_check_only(func_or_cls: _FT) -> _FT: ... @@ -1784,9 +1795,7 @@ class NamedTuple(tuple[Any, ...]): @overload def __init__(self, typename: str, fields: Iterable[tuple[str, Any]], /) -> None: ... @overload - @typing_extensions.deprecated( - "Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15" - ) + @deprecated("Creating a typing.NamedTuple using keyword arguments is deprecated and support will be removed in Python 3.15") def __init__(self, typename: str, fields: None = None, /, **kwargs: Any) -> None: ... @classmethod def _make(cls, iterable: Iterable[Any]) -> typing_extensions.Self: ... diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/typing_extensions.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/typing_extensions.pyi index 1e81194eadcac..2c42633cf9ece 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/typing_extensions.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/typing_extensions.pyi @@ -702,6 +702,7 @@ else: def __init__(self, name: str, tp: AnnotationForm) -> None: ... def __call__(self, obj: _T, /) -> _T: ... __supertype__: type | NewType + __name__: str if sys.version_info >= (3, 10): def __or__(self, other: Any) -> _SpecialForm: ... def __ror__(self, other: Any) -> _SpecialForm: ... diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/unittest/mock.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/unittest/mock.pyi index 615eec5fc45fe..bd8f519cc3b65 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/unittest/mock.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/unittest/mock.pyi @@ -322,6 +322,7 @@ class NonCallableMock(Base, Any): call_count: int call_args: _Call | MaybeNone call_args_list: _CallList + method_calls: _CallList mock_calls: _CallList def _format_mock_call_signature(self, args: Any, kwargs: Any) -> str: ... def _call_matcher(self, _call: tuple[_Call, ...]) -> _Call: diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/urllib/request.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/urllib/request.pyi index 4d9636102ed5c..7c56838c49cb2 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/urllib/request.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/urllib/request.pyi @@ -118,7 +118,14 @@ if sys.version_info < (3, 14): __all__ += ["URLopener", "FancyURLopener"] _T = TypeVar("_T") + +# The actual type is `addinfourl | HTTPResponse`, but users would need to use `typing.cast` or `isinstance` to narrow the type, +# so we use `Any` instead. +# See +# - https://github.com/python/typeshed/pull/15042 +# - https://github.com/python/typing/issues/566 _UrlopenRet: TypeAlias = Any + _DataType: TypeAlias = ReadableBuffer | SupportsRead[bytes] | Iterable[bytes] | None if sys.version_info >= (3, 13): diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/xml/etree/ElementTree.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/xml/etree/ElementTree.pyi index 99c3f287b639a..5af84b4915ca6 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/xml/etree/ElementTree.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/xml/etree/ElementTree.pyi @@ -260,6 +260,14 @@ class ElementTree(Generic[_Root]): def getroot(self) -> _Root: """Return root element of this tree.""" + def _setroot(self, element: Element[Any]) -> None: + """Replace root element of this tree. + + This will discard the current contents of the tree and replace it + with the given element. Use with care! + + """ + def parse(self, source: _FileRead, parser: XMLParser | None = None) -> Element: """Load external XML document into element tree. diff --git a/crates/ty_vendored/vendor/typeshed/stdlib/zipfile/__init__.pyi b/crates/ty_vendored/vendor/typeshed/stdlib/zipfile/__init__.pyi index 0389fe1cba78f..822fcc81d2d12 100644 --- a/crates/ty_vendored/vendor/typeshed/stdlib/zipfile/__init__.pyi +++ b/crates/ty_vendored/vendor/typeshed/stdlib/zipfile/__init__.pyi @@ -483,6 +483,15 @@ class ZipInfo: decide based upon the file_size and compress_size, if known, False otherwise. """ + if sys.version_info >= (3, 14): + def _for_archive(self, archive: ZipFile) -> Self: + """Resolve suitable defaults from the archive. + + Resolve the date_time, compression attributes, and external attributes + to suitable defaults as used by :method:`ZipFile.writestr`. + + Return self. + """ if sys.version_info >= (3, 12): from zipfile._path import CompleteDirs as CompleteDirs, Path as Path