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
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 @@
843c1fd5a148da85e523c1b4ee680226f89986aa
f8f0794d0fe249c06dc9f31a004d85be6cca6ced
58 changes: 57 additions & 1 deletion crates/ty_vendored/vendor/typeshed/stdlib/_bisect.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ common approach.
"""

import sys
from _typeshed import SupportsLenAndGetItem, SupportsRichComparisonT
from _typeshed import SupportsGetItem, SupportsLenAndGetItem, SupportsRichComparisonT
from collections.abc import Callable, MutableSequence
from typing import TypeVar, overload

Expand Down Expand Up @@ -35,6 +35,14 @@ if sys.version_info >= (3, 10):
A custom key function can be supplied to customize the sort order.
"""

@overload
def bisect_left(
a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int, hi: int, *, key: None = None
) -> int: ...
@overload
def bisect_left(
a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, *, hi: int, key: None = None
) -> int: ...
@overload
def bisect_left(
a: SupportsLenAndGetItem[_T],
Expand All @@ -45,6 +53,19 @@ if sys.version_info >= (3, 10):
key: Callable[[_T], SupportsRichComparisonT],
) -> int: ...
@overload
def bisect_left(
a: SupportsGetItem[int, _T], x: SupportsRichComparisonT, lo: int, hi: int, *, key: Callable[[_T], SupportsRichComparisonT]
) -> int: ...
@overload
def bisect_left(
a: SupportsGetItem[int, _T],
x: SupportsRichComparisonT,
lo: int = 0,
*,
hi: int,
key: Callable[[_T], SupportsRichComparisonT],
) -> int: ...
@overload
def bisect_right(
a: SupportsLenAndGetItem[SupportsRichComparisonT],
x: SupportsRichComparisonT,
Expand All @@ -65,6 +86,14 @@ if sys.version_info >= (3, 10):
A custom key function can be supplied to customize the sort order.
"""

@overload
def bisect_right(
a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int, hi: int, *, key: None = None
) -> int: ...
@overload
def bisect_right(
a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, *, hi: int, key: None = None
) -> int: ...
@overload
def bisect_right(
a: SupportsLenAndGetItem[_T],
Expand All @@ -75,6 +104,19 @@ if sys.version_info >= (3, 10):
key: Callable[[_T], SupportsRichComparisonT],
) -> int: ...
@overload
def bisect_right(
a: SupportsGetItem[int, _T], x: SupportsRichComparisonT, lo: int, hi: int, *, key: Callable[[_T], SupportsRichComparisonT]
) -> int: ...
@overload
def bisect_right(
a: SupportsGetItem[int, _T],
x: SupportsRichComparisonT,
lo: int = 0,
*,
hi: int,
key: Callable[[_T], SupportsRichComparisonT],
) -> int: ...
@overload
def insort_left(
a: MutableSequence[SupportsRichComparisonT],
x: SupportsRichComparisonT,
Expand Down Expand Up @@ -122,6 +164,7 @@ if sys.version_info >= (3, 10):
) -> None: ...

else:
@overload
def bisect_left(
a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None
) -> int:
Expand All @@ -135,6 +178,13 @@ else:
slice of a to be searched.
"""

@overload
def bisect_left(a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int, hi: int) -> int: ...
@overload
def bisect_left(
a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, *, hi: int
) -> int: ...
@overload
def bisect_right(
a: SupportsLenAndGetItem[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None
) -> int:
Expand All @@ -148,6 +198,12 @@ else:
slice of a to be searched.
"""

@overload
def bisect_right(a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int, hi: int) -> int: ...
@overload
def bisect_right(
a: SupportsGetItem[int, SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, *, hi: int
) -> int: ...
def insort_left(
a: MutableSequence[SupportsRichComparisonT], x: SupportsRichComparisonT, lo: int = 0, hi: int | None = None
) -> None:
Expand Down
35 changes: 14 additions & 21 deletions crates/ty_vendored/vendor/typeshed/stdlib/builtins.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -3053,18 +3053,11 @@ class dict(MutableMapping[_KT, _VT]):
def __class_getitem__(cls, item: Any, /) -> GenericAlias:
"""See PEP 585"""

@overload
def __or__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]:
def __or__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]:
"""Return self|value."""

@overload
def __or__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ...
@overload
def __ror__(self, value: dict[_KT, _VT], /) -> dict[_KT, _VT]:
def __ror__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]:
"""Return value|self."""

@overload
def __ror__(self, value: dict[_T1, _T2], /) -> dict[_KT | _T1, _VT | _T2]: ...
# dict.__ior__ should be kept roughly in line with MutableMapping.update()
@overload # type: ignore[misc]
def __ior__(self, value: SupportsKeysAndGetItem[_KT, _VT], /) -> Self:
Expand All @@ -3090,32 +3083,32 @@ class set(MutableSet[_T]):
def copy(self) -> set[_T]:
"""Return a shallow copy of a set."""

def difference(self, *s: Iterable[Any]) -> set[_T]:
def difference(self, *s: Iterable[object]) -> set[_T]:
"""Return a new set with elements in the set that are not in the others."""

def difference_update(self, *s: Iterable[Any]) -> None:
def difference_update(self, *s: Iterable[object]) -> None:
"""Update the set, removing elements found in others."""

def discard(self, element: _T, /) -> None:
def discard(self, element: object, /) -> None:
"""Remove an element from a set if it is a member.

Unlike set.remove(), the discard() method does not raise
an exception when an element is missing from the set.
"""

def intersection(self, *s: Iterable[Any]) -> set[_T]:
def intersection(self, *s: Iterable[object]) -> set[_T]:
"""Return a new set with elements common to the set and all others."""

def intersection_update(self, *s: Iterable[Any]) -> None:
def intersection_update(self, *s: Iterable[object]) -> None:
"""Update the set, keeping only elements found in it and all others."""

def isdisjoint(self, s: Iterable[Any], /) -> bool:
def isdisjoint(self, s: Iterable[object], /) -> bool:
"""Return True if two sets have a null intersection."""

def issubset(self, s: Iterable[Any], /) -> bool:
def issubset(self, s: Iterable[object], /) -> bool:
"""Report whether another set contains this set."""

def issuperset(self, s: Iterable[Any], /) -> bool:
def issuperset(self, s: Iterable[object], /) -> bool:
"""Report whether this set contains another set."""

def remove(self, element: _T, /) -> None:
Expand All @@ -3124,7 +3117,7 @@ class set(MutableSet[_T]):
If the element is not a member, raise a KeyError.
"""

def symmetric_difference(self, s: Iterable[_T], /) -> set[_T]:
def symmetric_difference(self, s: Iterable[_S], /) -> set[_T | _S]:
"""Return a new set with elements in either the set or other but not both."""

def symmetric_difference_update(self, s: Iterable[_T], /) -> None:
Expand Down Expand Up @@ -3195,7 +3188,7 @@ class frozenset(AbstractSet[_T_co]):
def intersection(self, *s: Iterable[object]) -> frozenset[_T_co]:
"""Return a new set with elements common to the set and all others."""

def isdisjoint(self, s: Iterable[_T_co], /) -> bool:
def isdisjoint(self, s: Iterable[object], /) -> bool:
"""Return True if two sets have a null intersection."""

def issubset(self, s: Iterable[object], /) -> bool:
Expand All @@ -3204,7 +3197,7 @@ class frozenset(AbstractSet[_T_co]):
def issuperset(self, s: Iterable[object], /) -> bool:
"""Report whether this set contains another set."""

def symmetric_difference(self, s: Iterable[_T_co], /) -> frozenset[_T_co]:
def symmetric_difference(self, s: Iterable[_S], /) -> frozenset[_T_co | _S]:
"""Return a new set with elements in either the set or other but not both."""

def union(self, *s: Iterable[_S]) -> frozenset[_T_co | _S]:
Expand All @@ -3219,7 +3212,7 @@ class frozenset(AbstractSet[_T_co]):
def __iter__(self) -> Iterator[_T_co]:
"""Implement iter(self)."""

def __and__(self, value: AbstractSet[_T_co], /) -> frozenset[_T_co]:
def __and__(self, value: AbstractSet[object], /) -> frozenset[_T_co]:
"""Return self&value."""

def __or__(self, value: AbstractSet[_S], /) -> frozenset[_T_co | _S]:
Expand Down
4 changes: 2 additions & 2 deletions crates/ty_vendored/vendor/typeshed/stdlib/contextlib.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ if sys.version_info >= (3, 10):

enter_result: _T
@overload
def __init__(self: nullcontext[None], enter_result: None = None) -> None: ...
def __init__(self: nullcontext[None]) -> None: ...
@overload
def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780
def __enter__(self) -> _T: ...
Expand All @@ -456,7 +456,7 @@ else:

enter_result: _T
@overload
def __init__(self: nullcontext[None], enter_result: None = None) -> None: ...
def __init__(self: nullcontext[None]) -> None: ...
@overload
def __init__(self: nullcontext[_T], enter_result: _T) -> None: ... # pyright: ignore[reportInvalidTypeVarUse] #11780
def __enter__(self) -> _T: ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ 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
if sys.version_info >= (3, 10):
# Added in Python 3.10.20, 3.11.15, 3.12.13, 3.13.12, 3.14.3
def make_parenthesis_pairs(value: Any) -> str:
"""Escape parenthesis and backslash for use within a comment."""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Written by Marc-Andre Lemburg (mal@lemburg.com).
import sys
from codecs import CodecInfo

from . import aliases as aliases

class CodecRegistryError(LookupError, SystemError): ...

def normalize_encoding(encoding: str | bytes) -> str:
Expand Down
Loading
Loading