Skip to content

Commit 573b57d

Browse files
Add missing defaults to third-party stubs (python#14617)
1 parent 8292678 commit 573b57d

File tree

54 files changed

+383
-376
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+383
-376
lines changed

stubs/Jetson.GPIO/Jetson/GPIO/gpio_event.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ BOTH_EDGE: Final = 3
99
def add_edge_detect(
1010
chip_fd: int, chip_name: str, channel: int, request: int, bouncetime: int, poll_time: float
1111
) -> Literal[1, 2, 0]: ...
12-
def remove_edge_detect(chip_name: str, channel: int, timeout: float = ...) -> None: ...
12+
def remove_edge_detect(chip_name: str, channel: int, timeout: float = 0.3) -> None: ...
1313
def add_edge_callback(chip_name: str, channel: int, callback: Callable[[int], None]) -> None: ...
1414
def edge_event_detected(chip_name: str, channel: int) -> bool: ...
1515
def gpio_event_added(chip_name: str, channel: int) -> Any: ...

stubs/PyYAML/yaml/emitter.pyi

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,26 @@ class Emitter:
6262
def __init__(
6363
self,
6464
stream: _WriteStream[Any],
65-
canonical: bool | None = ...,
66-
indent: int | None = ...,
67-
width: int | None = ...,
68-
allow_unicode: bool | None = ...,
69-
line_break: str | None = ...,
65+
canonical: bool | None = None,
66+
indent: int | None = None,
67+
width: int | None = None,
68+
allow_unicode: bool | None = None,
69+
line_break: str | None = None,
7070
) -> None: ...
7171
def dispose(self) -> None: ...
7272
def emit(self, event: Event) -> None: ...
7373
def need_more_events(self) -> bool: ...
7474
def need_events(self, count: int) -> bool: ...
75-
def increase_indent(self, flow: bool = ..., indentless: bool = ...) -> None: ...
75+
def increase_indent(self, flow: bool = False, indentless: bool = False) -> None: ...
7676
def expect_stream_start(self) -> None: ...
7777
def expect_nothing(self) -> NoReturn: ...
7878
def expect_first_document_start(self) -> None: ...
7979
def expect_document_start(self, first: bool = False) -> None: ...
8080
def expect_document_end(self) -> None: ...
8181
def expect_document_root(self) -> None: ...
82-
def expect_node(self, root: bool = ..., sequence: bool = ..., mapping: bool = ..., simple_key: bool = ...) -> None: ...
82+
def expect_node(
83+
self, root: bool = False, sequence: bool = False, mapping: bool = False, simple_key: bool = False
84+
) -> None: ...
8385
def expect_alias(self) -> None: ...
8486
def expect_scalar(self) -> None: ...
8587
def expect_flow_sequence(self) -> None: ...
@@ -92,10 +94,10 @@ class Emitter:
9294
def expect_flow_mapping_value(self) -> None: ...
9395
def expect_block_sequence(self) -> None: ...
9496
def expect_first_block_sequence_item(self) -> None: ...
95-
def expect_block_sequence_item(self, first: bool = ...) -> None: ...
97+
def expect_block_sequence_item(self, first: bool = False) -> None: ...
9698
def expect_block_mapping(self) -> None: ...
9799
def expect_first_block_mapping_key(self) -> None: ...
98-
def expect_block_mapping_key(self, first: bool = ...) -> None: ...
100+
def expect_block_mapping_key(self, first: bool = False) -> None: ...
99101
def expect_block_mapping_simple_value(self) -> None: ...
100102
def expect_block_mapping_value(self) -> None: ...
101103
def check_empty_sequence(self) -> bool: ...
@@ -115,17 +117,19 @@ class Emitter:
115117
def flush_stream(self) -> None: ...
116118
def write_stream_start(self) -> None: ...
117119
def write_stream_end(self) -> None: ...
118-
def write_indicator(self, indicator: str, need_whitespace: bool, whitespace: bool = ..., indention: bool = ...) -> None: ...
120+
def write_indicator(
121+
self, indicator: str, need_whitespace: bool, whitespace: bool = False, indention: bool = False
122+
) -> None: ...
119123
def write_indent(self) -> None: ...
120-
def write_line_break(self, data: str | None = ...) -> None: ...
124+
def write_line_break(self, data: str | None = None) -> None: ...
121125
def write_version_directive(self, version_text: str) -> None: ...
122126
def write_tag_directive(self, handle_text: str, prefix_text: str) -> None: ...
123-
def write_single_quoted(self, text: str, split: bool = ...) -> None: ...
127+
def write_single_quoted(self, text: str, split: bool = True) -> None: ...
124128
ESCAPE_REPLACEMENTS: dict[str, str]
125-
def write_double_quoted(self, text: str, split: bool = ...) -> None: ...
129+
def write_double_quoted(self, text: str, split: bool = True) -> None: ...
126130
def determine_block_hints(self, text: str) -> str: ...
127131
def write_folded(self, text: str) -> None: ...
128132
def write_literal(self, text: str) -> None: ...
129-
def write_plain(self, text: str, split: bool = ...) -> None: ...
133+
def write_plain(self, text: str, split: bool = True) -> None: ...
130134

131135
__all__ = ["Emitter", "EmitterError"]

stubs/WebOb/webob/cachecontrol.pyi

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ class UpdateDict(dict[str, Any]):
1414
updated_args: tuple[Any, ...] | None
1515

1616
class exists_property(Generic[_ScopeT]):
17-
def __init__(self, prop: str, type: _ScopeT = ...) -> None: ...
17+
@overload
18+
def __init__(self: exists_property[None], prop: str) -> None: ...
19+
@overload
20+
def __init__(self, prop: str, type: _ScopeT) -> None: ...
1821
@overload
1922
def __get__(self, obj: None, type: type[CacheControl[Any]] | None = None) -> Self: ...
2023
@overload
@@ -31,7 +34,7 @@ class exists_property(Generic[_ScopeT]):
3134
def __delete__(self, obj: CacheControl[_ScopeT]) -> None: ...
3235

3336
class value_property(Generic[_T, _DefaultT, _NoneLiteral, _ScopeT]):
34-
def __init__(self, prop: str, default: _DefaultT = ..., none: _NoneLiteral = ..., type: _ScopeT = ...) -> None: ...
37+
def __init__(self, prop: str, default: _DefaultT = None, none: _NoneLiteral = None, type: _ScopeT = None) -> None: ... # type: ignore[assignment]
3538
@overload
3639
def __get__(self, obj: None, type: type[CacheControl[Any]] | None = None) -> Self: ...
3740
@overload

stubs/aiofiles/aiofiles/os.pyi

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async def remove(
6969
path: StrOrBytesPath, *, dir_fd: int | None = None, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
7070
) -> None: ...
7171
async def unlink(
72-
path: StrOrBytesPath, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
72+
path: StrOrBytesPath, *, dir_fd: int | None = None, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
7373
) -> None: ...
7474
async def mkdir(
7575
path: StrOrBytesPath,
@@ -91,23 +91,23 @@ async def link(
9191
src: StrOrBytesPath,
9292
dst: StrOrBytesPath,
9393
*,
94-
src_dir_fd: int | None = ...,
95-
dst_dir_fd: int | None = ...,
96-
follow_symlinks: bool = ...,
94+
src_dir_fd: int | None = None,
95+
dst_dir_fd: int | None = None,
96+
follow_symlinks: bool = True,
9797
loop: AbstractEventLoop | None = ...,
9898
executor: Executor | None = ...,
9999
) -> None: ...
100100
async def symlink(
101101
src: StrOrBytesPath,
102102
dst: StrOrBytesPath,
103-
target_is_directory: bool = ...,
103+
target_is_directory: bool = False,
104104
*,
105-
dir_fd: int | None = ...,
105+
dir_fd: int | None = None,
106106
loop: AbstractEventLoop | None = ...,
107107
executor: Executor | None = ...,
108108
) -> None: ...
109109
async def readlink(
110-
path: AnyStr, *, dir_fd: int | None = ..., loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
110+
path: AnyStr, *, dir_fd: int | None = None, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
111111
) -> AnyStr: ...
112112
async def rmdir(
113113
path: StrOrBytesPath, *, dir_fd: int | None = None, loop: AbstractEventLoop | None = ..., executor: Executor | None = ...
@@ -157,9 +157,9 @@ if sys.platform != "win32":
157157
in_fd: int,
158158
offset: int,
159159
count: int,
160-
headers: Sequence[ReadableBuffer] = ...,
161-
trailers: Sequence[ReadableBuffer] = ...,
162-
flags: int = ...,
160+
headers: Sequence[ReadableBuffer] = (),
161+
trailers: Sequence[ReadableBuffer] = (),
162+
flags: int = 0,
163163
*,
164164
loop: AbstractEventLoop | None = ...,
165165
executor: Executor | None = ...,

stubs/auth0-python/auth0/authentication/token_verifier.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ class SymmetricSignatureVerifier(SignatureVerifier):
1111

1212
class JwksFetcher:
1313
CACHE_TTL: ClassVar[int]
14-
def __init__(self, jwks_url: str, cache_ttl: int = ...) -> None: ...
14+
def __init__(self, jwks_url: str, cache_ttl: int = 600) -> None: ...
1515
def get_key(self, key_id: str): ...
1616

1717
class AsymmetricSignatureVerifier(SignatureVerifier):
18-
def __init__(self, jwks_url: str, algorithm: str = "RS256", cache_ttl: int = ...) -> None: ...
18+
def __init__(self, jwks_url: str, algorithm: str = "RS256", cache_ttl: int = 600) -> None: ...
1919

2020
class TokenVerifier:
2121
iss: str

stubs/boltons/boltons/dictutils.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class OrderedMultiDict(dict[_KT, _VT]):
3030
def popall(self, k: _KT, default: _VT = ...) -> list[_VT]: ...
3131
def poplast(self, k: _KT = ..., default: _VT = ...) -> _VT: ...
3232
@overload # type: ignore[override]
33-
def setdefault(self, k: _KT, default: None = ...) -> _VT | None: ...
33+
def setdefault(self, k: _KT, default: None = None) -> _VT | None: ...
3434
@overload
3535
def setdefault(self, k: _KT, default: _VT) -> _VT: ...
3636
def sorted(self, key: _KT | None = None, reverse: bool = False) -> Self: ...

stubs/cffi/cffi/api.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class FFI:
2929
if sys.platform == "win32":
3030
def dlopen(self, name: str, flags: int = ...) -> _cffi_backend.Lib: ...
3131
else:
32-
def dlopen(self, name: str | None, flags: int = ...) -> _cffi_backend.Lib: ...
32+
def dlopen(self, name: str | None, flags: int = 0) -> _cffi_backend.Lib: ...
3333

3434
def dlclose(self, lib: _cffi_backend.Lib) -> None: ...
3535
def typeof(self, cdecl: str | CData | types.BuiltinFunctionType | types.FunctionType) -> CType: ...

stubs/cffi/cffi/pkgconfig.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from collections.abc import Sequence
22

33
def merge_flags(cfg1: dict[str, list[str]], cfg2: dict[str, list[str]]) -> dict[str, list[str]]: ...
4-
def call(libname: str, flag: str, encoding: str = ...) -> str: ...
4+
def call(libname: str, flag: str, encoding: str = "utf-8") -> str: ...
55
def flags_from_pkgconfig(libs: Sequence[str]) -> dict[str, list[str]]: ...

stubs/channels/channels/layers.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class InMemoryChannelLayer(BaseChannelLayer):
7272
expiry: int = 60,
7373
group_expiry: int = 86400,
7474
capacity: int = 100,
75-
channel_capacity: _ChannelCapacityDict | None = ...,
75+
channel_capacity: _ChannelCapacityDict | None = None,
7676
) -> None: ...
7777

7878
extensions: list[str]
@@ -86,6 +86,6 @@ class InMemoryChannelLayer(BaseChannelLayer):
8686
async def group_discard(self, group: str, channel: str) -> None: ...
8787
async def group_send(self, group: str, message: dict[str, Any]) -> None: ...
8888

89-
def get_channel_layer(alias: str = ...) -> BaseChannelLayer | None: ...
89+
def get_channel_layer(alias: str = "default") -> BaseChannelLayer | None: ...
9090

9191
channel_layers: ChannelLayerManager

stubs/defusedxml/defusedxml/lxml.pyi

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ class _ElementBase: ...
3030
class RestrictedElement(_ElementBase):
3131
blacklist: Incomplete
3232
def __iter__(self): ...
33-
def iterchildren(self, tag: Incomplete | None = ..., reversed: bool = ...): ...
34-
def iter(self, tag: Incomplete | None = ..., *tags): ...
35-
def iterdescendants(self, tag: Incomplete | None = ..., *tags): ...
36-
def itersiblings(self, tag: Incomplete | None = ..., preceding: bool = ...): ...
33+
def iterchildren(self, tag=None, reversed: bool = False): ...
34+
def iter(self, tag=None, *tags): ...
35+
def iterdescendants(self, tag=None, *tags): ...
36+
def itersiblings(self, tag=None, preceding: bool = False): ...
3737
def getchildren(self): ...
38-
def getiterator(self, tag: Incomplete | None = ...): ...
38+
def getiterator(self, tag=None): ...
3939

4040
class GlobalParserTLS(threading.local):
4141
parser_config: Incomplete
@@ -46,16 +46,8 @@ class GlobalParserTLS(threading.local):
4646

4747
def getDefaultParser(): ...
4848
def check_docinfo(elementtree, forbid_dtd: bool = False, forbid_entities: bool = True) -> None: ...
49-
def parse(
50-
source,
51-
parser: Incomplete | None = ...,
52-
base_url: Incomplete | None = ...,
53-
forbid_dtd: bool = ...,
54-
forbid_entities: bool = ...,
55-
): ...
56-
def fromstring(
57-
text, parser: Incomplete | None = ..., base_url: Incomplete | None = ..., forbid_dtd: bool = ..., forbid_entities: bool = ...
58-
): ...
49+
def parse(source, parser=None, base_url=None, forbid_dtd: bool = False, forbid_entities: bool = True): ...
50+
def fromstring(text, parser=None, base_url=None, forbid_dtd: bool = False, forbid_entities: bool = True): ...
5951

6052
XML = fromstring
6153

0 commit comments

Comments
 (0)