Skip to content

Commit 3930d8d

Browse files
authored
Make several type aliases private (#7661)
1 parent 67425a8 commit 3930d8d

File tree

4 files changed

+16
-15
lines changed

4 files changed

+16
-15
lines changed

stdlib/_threading_local.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ from typing_extensions import TypeAlias
33
from weakref import ReferenceType
44

55
__all__ = ["local"]
6-
localdict: TypeAlias = dict[Any, Any]
6+
_localdict: TypeAlias = dict[Any, Any]
77

88
class _localimpl:
99
key: str
10-
dicts: dict[int, tuple[ReferenceType[Any], localdict]]
10+
dicts: dict[int, tuple[ReferenceType[Any], _localdict]]
1111
def __init__(self) -> None: ...
12-
def get_dict(self) -> localdict: ...
13-
def create_dict(self) -> localdict: ...
12+
def get_dict(self) -> _localdict: ...
13+
def create_dict(self) -> _localdict: ...
1414

1515
class local:
1616
def __getattribute__(self, name: str) -> Any: ...

stdlib/audioop.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from typing_extensions import TypeAlias
22

3-
AdpcmState: TypeAlias = tuple[int, int]
4-
RatecvState: TypeAlias = tuple[int, tuple[tuple[int, int], ...]]
3+
_AdpcmState: TypeAlias = tuple[int, int]
4+
_RatecvState: TypeAlias = tuple[int, tuple[tuple[int, int], ...]]
55

66
class error(Exception): ...
77

88
def add(__fragment1: bytes, __fragment2: bytes, __width: int) -> bytes: ...
9-
def adpcm2lin(__fragment: bytes, __width: int, __state: AdpcmState | None) -> tuple[bytes, AdpcmState]: ...
9+
def adpcm2lin(__fragment: bytes, __width: int, __state: _AdpcmState | None) -> tuple[bytes, _AdpcmState]: ...
1010
def alaw2lin(__fragment: bytes, __width: int) -> bytes: ...
1111
def avg(__fragment: bytes, __width: int) -> int: ...
1212
def avgpp(__fragment: bytes, __width: int) -> int: ...
@@ -17,7 +17,7 @@ def findfactor(__fragment: bytes, __reference: bytes) -> float: ...
1717
def findfit(__fragment: bytes, __reference: bytes) -> tuple[int, float]: ...
1818
def findmax(__fragment: bytes, __length: int) -> int: ...
1919
def getsample(__fragment: bytes, __width: int, __index: int) -> int: ...
20-
def lin2adpcm(__fragment: bytes, __width: int, __state: AdpcmState | None) -> tuple[bytes, AdpcmState]: ...
20+
def lin2adpcm(__fragment: bytes, __width: int, __state: _AdpcmState | None) -> tuple[bytes, _AdpcmState]: ...
2121
def lin2alaw(__fragment: bytes, __width: int) -> bytes: ...
2222
def lin2lin(__fragment: bytes, __width: int, __newwidth: int) -> bytes: ...
2323
def lin2ulaw(__fragment: bytes, __width: int) -> bytes: ...
@@ -31,10 +31,10 @@ def ratecv(
3131
__nchannels: int,
3232
__inrate: int,
3333
__outrate: int,
34-
__state: RatecvState | None,
34+
__state: _RatecvState | None,
3535
__weightA: int = ...,
3636
__weightB: int = ...,
37-
) -> tuple[bytes, RatecvState]: ...
37+
) -> tuple[bytes, _RatecvState]: ...
3838
def reverse(__fragment: bytes, __width: int) -> bytes: ...
3939
def rms(__fragment: bytes, __width: int) -> int: ...
4040
def tomono(__fragment: bytes, __width: int, __lfactor: float, __rfactor: float) -> bytes: ...

stdlib/itertools.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ _T6 = TypeVar("_T6")
2020

2121
_Step: TypeAlias = int | float | SupportsFloat | SupportsInt | SupportsIndex | SupportsComplex
2222

23-
Predicate: TypeAlias = Callable[[_T], object]
23+
_Predicate: TypeAlias = Callable[[_T], object]
2424

2525
# Technically count can take anything that implements a number protocol and has an add method
2626
# but we can't enforce the add method
@@ -76,12 +76,12 @@ class compress(Iterator[_T], Generic[_T]):
7676
def __next__(self) -> _T: ...
7777

7878
class dropwhile(Iterator[_T], Generic[_T]):
79-
def __init__(self, __predicate: Predicate[_T], __iterable: Iterable[_T]) -> None: ...
79+
def __init__(self, __predicate: _Predicate[_T], __iterable: Iterable[_T]) -> None: ...
8080
def __iter__(self: Self) -> Self: ...
8181
def __next__(self) -> _T: ...
8282

8383
class filterfalse(Iterator[_T], Generic[_T]):
84-
def __init__(self, __predicate: Predicate[_T] | None, __iterable: Iterable[_T]) -> None: ...
84+
def __init__(self, __predicate: _Predicate[_T] | None, __iterable: Iterable[_T]) -> None: ...
8585
def __iter__(self: Self) -> Self: ...
8686
def __next__(self) -> _T: ...
8787

@@ -107,7 +107,7 @@ class starmap(Iterator[_T], Generic[_T]):
107107
def __next__(self) -> _T: ...
108108

109109
class takewhile(Iterator[_T], Generic[_T]):
110-
def __init__(self, __predicate: Predicate[_T], __iterable: Iterable[_T]) -> None: ...
110+
def __init__(self, __predicate: _Predicate[_T], __iterable: Iterable[_T]) -> None: ...
111111
def __iter__(self: Self) -> Self: ...
112112
def __next__(self) -> _T: ...
113113

stdlib/sqlite3/dbapi2.pyi

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,8 @@ class InternalError(DatabaseError): ...
410410
class NotSupportedError(DatabaseError): ...
411411
class OperationalError(DatabaseError): ...
412412

413-
OptimizedUnicode = str
413+
if sys.version_info < (3, 10):
414+
OptimizedUnicode = str
414415

415416
@final
416417
class PrepareProtocol:

0 commit comments

Comments
 (0)