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
24 changes: 12 additions & 12 deletions crates/ty_ide/src/inlay_hints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7448,14 +7448,14 @@ mod tests {
A = TypeAliasType([name=]'A', [value=]str)
---------------------------------------------
info[inlay-hint-location]: Inlay Hint Target
--> stdlib/typing.pyi:2549:26
--> stdlib/typing.pyi:2561:26
|
2547 | """
2548 |
2549 | def __new__(cls, name: str, value: Any, *, type_params: tuple[_TypeParameter, ...] = ()) -> Self: ...
2559 | """
2560 |
2561 | def __new__(cls, name: str, value: Any, *, type_params: tuple[_TypeParameter, ...] = ()) -> Self: ...
| ^^^^
2550 | @property
2551 | def __value__(self) -> Any: ... # AnnotationForm
2562 | @property
2563 | def __value__(self) -> Any: ... # AnnotationForm
|
info: Source
--> main2.py:3:20
Expand All @@ -7466,14 +7466,14 @@ mod tests {
|

info[inlay-hint-location]: Inlay Hint Target
--> stdlib/typing.pyi:2549:37
--> stdlib/typing.pyi:2561:37
|
2547 | """
2548 |
2549 | def __new__(cls, name: str, value: Any, *, type_params: tuple[_TypeParameter, ...] = ()) -> Self: ...
2559 | """
2560 |
2561 | def __new__(cls, name: str, value: Any, *, type_params: tuple[_TypeParameter, ...] = ()) -> Self: ...
| ^^^^^
2550 | @property
2551 | def __value__(self) -> Any: ... # AnnotationForm
2562 | @property
2563 | def __value__(self) -> Any: ... # AnnotationForm
|
info: Source
--> main2.py:3:32
Expand Down
2 changes: 1 addition & 1 deletion crates/ty_vendored/vendor/typeshed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ the project the stubs are for, but instead report them here to typeshed.**
Further documentation on stub files, typeshed, and Python's typing system in
general, can also be found at https://typing.readthedocs.io/en/latest/.

Typeshed supports Python versions 3.9 to 3.14.
Typeshed supports Python versions 3.10 to 3.14.

## Using

Expand Down
2 changes: 1 addition & 1 deletion crates/ty_vendored/vendor/typeshed/source_commit.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
fa659b1def704dea3dc8e25c7857b23eac69df4d
1b3cec156330a93f6bb22b6636bca38c27f8f721
1 change: 1 addition & 0 deletions crates/ty_vendored/vendor/typeshed/stdlib/VERSIONS
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ py_compile: 3.0-
pyclbr: 3.0-
pydoc: 3.0-
pydoc_data: 3.0-
pydoc_data.module_docs: 3.13-
pyexpat: 3.0-
queue: 3.0-
quopri: 3.0-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Unit tests are in test_collections.
import sys
from abc import abstractmethod
from types import MappingProxyType
from typing import ( # noqa: Y022,Y038,UP035,Y057
from typing import ( # noqa: Y022,Y038,UP035,Y057,RUF100
AbstractSet as Set,
AsyncGenerator as AsyncGenerator,
AsyncIterable as AsyncIterable,
Expand Down
4 changes: 2 additions & 2 deletions crates/ty_vendored/vendor/typeshed/stdlib/_struct.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ The optional first format char indicates byte order, size and alignment:
The remaining chars indicate types of args and must match exactly;
these can be preceded by a decimal repeat count:
x: pad byte (no data); c:char; b:signed byte; B:unsigned byte;
?: _Bool (requires C99; if not available, char is used instead)
h:short; H:unsigned short; i:int; I:unsigned int;
?:_Bool; h:short; H:unsigned short; i:int; I:unsigned int;
l:long; L:unsigned long; f:float; d:double; e:half-float.
F:float complex; D:double complex.
Special cases (preceding decimal count indicates length):
s:string (array of char); p: pascal string (with count byte).
Special cases (only available in native format):
Expand Down
5 changes: 4 additions & 1 deletion crates/ty_vendored/vendor/typeshed/stdlib/argparse.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,10 @@ class HelpFormatter:
def _format_usage(
self, usage: str | None, actions: Iterable[Action], groups: Iterable[_MutuallyExclusiveGroup], prefix: str | None
) -> str: ...
def _format_actions_usage(self, actions: Iterable[Action], groups: Iterable[_MutuallyExclusiveGroup]) -> str: ...
if sys.version_info < (3, 14):
# Removed in Python 3.14.3
def _format_actions_usage(self, actions: Iterable[Action], groups: Iterable[_MutuallyExclusiveGroup]) -> str: ...

def _format_text(self, text: str) -> str: ...
def _format_action(self, action: Action) -> str: ...
def _format_action_invocation(self, action: Action) -> str: ...
Expand Down
2 changes: 1 addition & 1 deletion crates/ty_vendored/vendor/typeshed/stdlib/ast.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1679,7 +1679,7 @@ class ExceptHandler(excepthandler):
"""Return a copy of the AST node with new values for the specified fields."""

class arguments(AST):
"""arguments(arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs, expr* kw_defaults, arg? kwarg, expr* defaults)"""
"""arguments(arg* posonlyargs, arg* args, arg? vararg, arg* kwonlyargs, expr?* kw_defaults, arg? kwarg, expr* defaults)"""

if sys.version_info >= (3, 10):
__match_args__ = ("posonlyargs", "args", "vararg", "kwonlyargs", "kw_defaults", "kwarg", "defaults")
Expand Down
10 changes: 5 additions & 5 deletions crates/ty_vendored/vendor/typeshed/stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ from types import CellType, CodeType, GenericAlias, TracebackType

# mypy crashes if any of {ByteString, Sequence, MutableSequence, Mapping, MutableMapping}
# are imported from collections.abc in builtins.pyi
from typing import ( # noqa: Y022,UP035
from typing import ( # noqa: Y022,UP035,RUF100
IO,
Any,
BinaryIO,
Expand Down Expand Up @@ -3409,7 +3409,7 @@ def ascii(obj: object, /) -> str:
to that returned by repr() in Python 2.
"""

def bin(number: int | SupportsIndex, /) -> str:
def bin(number: SupportsIndex, /) -> str:
"""Return the binary representation of an integer.

>>> bin(2796202)
Expand All @@ -3430,7 +3430,7 @@ def callable(obj: object, /) -> TypeIs[Callable[..., object]]:
__call__() method.
"""

def chr(i: int | SupportsIndex, /) -> str:
def chr(i: SupportsIndex, /) -> str:
"""Return a Unicode string of one character with ordinal i; 0 <= i <= 0x10ffff."""

if sys.version_info >= (3, 10):
Expand Down Expand Up @@ -3715,7 +3715,7 @@ def hash(obj: object, /) -> int:

help: _sitebuiltins._Helper

def hex(number: int | SupportsIndex, /) -> str:
def hex(number: SupportsIndex, /) -> str:
"""Return the hexadecimal representation of an integer.

>>> hex(12648430)
Expand Down Expand Up @@ -3967,7 +3967,7 @@ def next(i: SupportsNext[_T], /) -> _T:

@overload
def next(i: SupportsNext[_T], default: _VT, /) -> _T | _VT: ...
def oct(number: int | SupportsIndex, /) -> str:
def oct(number: SupportsIndex, /) -> str:
"""Return the octal representation of an integer.

>>> oct(342391)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ It is returned in place of lists of (ctext/quoted-pair) and
XXX: provide complete list of token types.
"""

import sys
from collections.abc import Iterable, Iterator
from email.errors import HeaderParseError, MessageDefect
from email.policy import Policy
Expand Down Expand Up @@ -96,6 +97,11 @@ def make_quoted_pairs(value: Any) -> str:

def quote_string(value: Any) -> str: ...

if sys.version_info >= (3, 13):
# Added in Python 3.13.12, 3.14.3
def make_parenthesis_pairs(value: Any) -> str:
"""Escape parenthesis and backslash for use within a comment."""

rfc2047_matcher: Final[Pattern[str]]

class TokenList(list[TokenList | Terminal]):
Expand Down Expand Up @@ -384,6 +390,13 @@ class MessageID(MsgID):
class InvalidMessageID(MessageID):
token_type: str

if sys.version_info >= (3, 13):
# Added in Python 3.13.12, 3.14.3
class MessageIDList(TokenList):
token_type: str
@property
def message_ids(self) -> list[MsgID | Terminal]: ...

class Header(TokenList):
token_type: str

Expand Down Expand Up @@ -681,6 +694,13 @@ def get_msg_id(value: str) -> tuple[MsgID, str]:
def parse_message_id(value: str) -> MessageID:
"""message-id = "Message-ID:" msg-id CRLF"""

if sys.version_info >= (3, 13):
# Added in Python 3.13.12, 3.14.3
def parse_message_ids(value: str) -> MessageIDList:
"""in-reply-to = "In-Reply-To:" 1*msg-id CRLF
references = "References:" 1*msg-id CRLF
"""

def parse_mime_version(value: str) -> MIMEVersion:
"""mime-version = [CFWS] 1*digit [CFWS] "." [CFWS] 1*digit [CFWS]"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This module provides an implementation of the HeaderRegistry API.
The implementation is designed to flexibly follow RFC5322 rules.
"""

import sys
import types
from collections.abc import Iterable, Mapping
from datetime import datetime as _datetime
Expand Down Expand Up @@ -248,6 +249,20 @@ class MessageIDHeader:
def value_parser(value: str) -> MessageID:
"""message-id = "Message-ID:" msg-id CRLF"""

if sys.version_info >= (3, 13):
from email._header_value_parser import MessageIDList

# Added in Python 3.13.12, 3.14.3
class ReferencesHeader:
max_count: ClassVar[Literal[1]]
@classmethod
def parse(cls, value: str, kwds: dict[str, Any]) -> None: ...
@staticmethod
def value_parser(value: str) -> MessageIDList:
"""in-reply-to = "In-Reply-To:" 1*msg-id CRLF
references = "References:" 1*msg-id CRLF
"""

@type_check_only
class _HeaderParser(Protocol):
max_count: ClassVar[Literal[1] | None]
Expand Down
13 changes: 12 additions & 1 deletion crates/ty_vendored/vendor/typeshed/stdlib/enum.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import types
from _typeshed import SupportsKeysAndGetItem, Unused
from builtins import property as _builtins_property
from collections.abc import Callable, Iterable, Iterator, Mapping
from typing import Any, Final, Generic, Literal, TypeVar, overload
from typing import Any, Final, Generic, Literal, SupportsIndex, TypeVar, overload
from typing_extensions import Self, TypeAlias, disjoint_base

__all__ = ["EnumMeta", "Enum", "IntEnum", "Flag", "IntFlag", "auto", "unique"]
Expand Down Expand Up @@ -625,6 +625,17 @@ if sys.version_info >= (3, 11):
"""

def show_flag_values(value: int) -> list[int]: ...
def bin(num: SupportsIndex, max_bits: int | None = None) -> str:
"""
Like built-in bin(), except negative values are represented in
twos-complement, and the leading bit always indicates sign
(0=positive, 1=negative).

>>> bin(10)
'0b0 1010'
>>> bin(~10) # ~10 is -11
'0b1 0101'
"""

if sys.version_info >= (3, 12):
# The body of the class is the same, but the base classes are different.
Expand Down
4 changes: 2 additions & 2 deletions crates/ty_vendored/vendor/typeshed/stdlib/http/cookies.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ within a string. Escaped quotation marks, nested semicolons, and other
such trickeries do not confuse it.

>>> C = cookies.SimpleCookie()
>>> C.load('keebler="E=everybody; L=\\\\"Loves\\\\"; fudge=\\\\012;";')
>>> C.load('keebler="E=everybody; L=\\\\"Loves\\\\"; fudge=;";')
>>> print(C)
Set-Cookie: keebler="E=everybody; L=\\"Loves\\"; fudge=\\012;"
Set-Cookie: keebler="E=everybody; L=\\"Loves\\"; fudge=;"

Each element of the Cookie also supports all of the RFC 2109
Cookie attributes. Here's an example which sets the Path
Expand Down
1 change: 1 addition & 0 deletions crates/ty_vendored/vendor/typeshed/stdlib/inspect.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,7 @@ def isgenerator(object: object) -> TypeIs[GeneratorType[Any, Any, Any]]:
gi_frame frame object or possibly None once the generator has
been exhausted
gi_running set to 1 when generator is executing, 0 otherwise
gi_suspended set to 1 when the generator is suspended at a yield point, 0 otherwise
gi_yieldfrom object being iterated by yield from or None

__iter__() defined to support iteration over container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1464,6 +1464,7 @@ class FileHandler(StreamHandler[TextIOWrapper]):
encoding: str | None # undocumented
delay: bool # undocumented
errors: str | None # undocumented
stream: TextIOWrapper | None # type: ignore[assignment] # None when delay=True or after close()
def __init__(
self, filename: StrPath, mode: str = "a", encoding: str | None = None, delay: bool = False, errors: str | None = None
) -> None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,32 @@ class ForkServer:
"""

if sys.version_info >= (3, 14):
# `sys_argv` parameter added in Python 3.14.3
def main(
listener_fd: int | None,
alive_r: FileDescriptorLike,
preload: Sequence[str],
main_path: str | None = None,
sys_path: list[str] | None = None,
*,
sys_argv: list[str] | None = None,
authkey_r: int | None = None,
) -> None:
"""Run forkserver."""

elif sys.version_info >= (3, 13):
# `sys_argv` parameter added in Python 3.13.12
def main(
listener_fd: int | None,
alive_r: FileDescriptorLike,
preload: Sequence[str],
main_path: str | None = None,
sys_path: list[str] | None = None,
*,
sys_argv: list[str] | None = None,
) -> None:
"""Run forkserver."""

else:
def main(
listener_fd: int | None,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from typing import Final

module_docs: Final[dict[str, str]]
2 changes: 1 addition & 1 deletion crates/ty_vendored/vendor/typeshed/stdlib/socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1590,7 +1590,7 @@ def getfqdn(name: str = "") -> str:

if sys.version_info >= (3, 11):
def create_connection(
address: tuple[str | None, int],
address: tuple[str | None, bytes | str | int | None],
timeout: float | None = ...,
source_address: _Address | None = None,
*,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ class Connection:
self, name: str, num_params: int, aggregate_class: Callable[[], _WindowAggregateClass] | None, /
) -> None: ...

def create_collation(self, name: str, callback: Callable[[str, str], int | SupportsIndex] | None, /) -> None:
def create_collation(self, name: str, callback: Callable[[str, str], SupportsIndex] | None, /) -> None:
"""Creates a collation function."""

def create_function(
Expand Down
4 changes: 2 additions & 2 deletions crates/ty_vendored/vendor/typeshed/stdlib/struct.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ The optional first format char indicates byte order, size and alignment:
The remaining chars indicate types of args and must match exactly;
these can be preceded by a decimal repeat count:
x: pad byte (no data); c:char; b:signed byte; B:unsigned byte;
?: _Bool (requires C99; if not available, char is used instead)
h:short; H:unsigned short; i:int; I:unsigned int;
?:_Bool; h:short; H:unsigned short; i:int; I:unsigned int;
l:long; L:unsigned long; f:float; d:double; e:half-float.
F:float complex; D:double complex.
Special cases (preceding decimal count indicates length):
s:string (array of char); p: pascal string (with count byte).
Special cases (only available in native format):
Expand Down
12 changes: 6 additions & 6 deletions crates/ty_vendored/vendor/typeshed/stdlib/tarfile.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,16 @@ class TarFile:
OPEN_METH: ClassVar[Mapping[str, str]]
name: StrOrBytesPath | None
mode: Literal["r", "a", "w", "x"]
fileobj: _Fileobj | None
format: _TarFormat | None
fileobj: _Fileobj
format: _TarFormat
tarinfo: type[TarInfo]
dereference: bool | None
ignore_zeros: bool | None
encoding: str | None
dereference: bool
ignore_zeros: bool
encoding: str
errors: str
fileobject: type[ExFileObject] # undocumented
pax_headers: Mapping[str, str]
debug: int | None
debug: int
errorlevel: int
offset: int # undocumented
extraction_filter: _FilterFunction | None
Expand Down
Loading
Loading