Skip to content

Commit 18b78b9

Browse files
authored
Merge branch 'main' into psutil-use-stricter-settings
2 parents b99988d + 0153c40 commit 18b78b9

File tree

19 files changed

+88
-45
lines changed

19 files changed

+88
-45
lines changed

MAINTAINERS.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,12 @@ When rejecting a PR for a change for a future Python version, use a message
8888
like:
8989

9090
Thanks for contributing! Unfortunately, [as outlined in our CONTRIBUTING document](https://github.com/python/typeshed/blob/main/CONTRIBUTING.md#standard-library-stubs) we only accept pull requests to the standard library for future Python versions after the first beta version has been released. This is in part to prevent churn in the stubs, and in part because the testing infrastructure for the future version is not yet in place. Please feel free to open a new PR when the first beta version has been released. Alternatively, if this PR is still relevant, you can leave a comment here to reopen it.
91+
92+
### Closing requests for third-party stubs
93+
94+
We don't keep requests for third-party library stubs open. Close those
95+
requests as "not planned" with an explanation like this:
96+
97+
We gladly accept type stub contributions for third-party libraries that are published on PyPI in typeshed. To contribute a new library, please follow the steps outlined in [CONTRIBUTING.md](/python/typeshed/blob/main/CONTRIBUTING.md). The `create_baseline_stubs.py` script can be useful to create an initial version, suitable for inclusion in typeshed.
98+
99+
That said, we don't keep requests for third-party library stubs open, unless there are issues that need to be addressed before a PR can be opened. Therefore, I'm closing this issue.

stdlib/_zstd.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ class ZstdCompressor:
4646
FLUSH_BLOCK: Final = 1
4747
FLUSH_FRAME: Final = 2
4848
def __new__(
49-
cls, level: int | None = None, options: Mapping[int, int] | None = None, zstd_dict: ZstdDict | None = None
49+
cls,
50+
level: int | None = None,
51+
options: Mapping[int, int] | None = None,
52+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
5053
) -> Self: ...
5154
def compress(
5255
self, /, data: ReadableBuffer, mode: _ZstdCompressorContinue | _ZstdCompressorFlushBlock | _ZstdCompressorFlushFrame = 0
@@ -58,7 +61,9 @@ class ZstdCompressor:
5861

5962
@final
6063
class ZstdDecompressor:
61-
def __new__(cls, zstd_dict: ZstdDict | None = None, options: Mapping[int, int] | None = None) -> Self: ...
64+
def __new__(
65+
cls, zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None, options: Mapping[int, int] | None = None
66+
) -> Self: ...
6267
def decompress(self, /, data: ReadableBuffer, max_length: int = -1) -> bytes: ...
6368
@property
6469
def eof(self) -> bool: ...

stdlib/argparse.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,11 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
249249
def _read_args_from_files(self, arg_strings: list[str]) -> list[str]: ...
250250
def _match_argument(self, action: Action, arg_strings_pattern: str) -> int: ...
251251
def _match_arguments_partial(self, actions: Sequence[Action], arg_strings_pattern: str) -> list[int]: ...
252-
def _parse_optional(self, arg_string: str) -> tuple[Action | None, str, str | None] | None: ...
252+
if sys.version_info >= (3, 12):
253+
def _parse_optional(self, arg_string: str) -> list[tuple[Action | None, str, str | None, str | None]] | None: ...
254+
else:
255+
def _parse_optional(self, arg_string: str) -> tuple[Action | None, str, str | None] | None: ...
256+
253257
def _get_option_tuples(self, option_string: str) -> list[tuple[Action, str, str | None]]: ...
254258
def _get_nargs_pattern(self, action: Action) -> str: ...
255259
def _get_values(self, action: Action, arg_strings: list[str]) -> Any: ...

stdlib/compression/zstd/__init__.pyi

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,14 @@ def get_frame_info(frame_buffer: ReadableBuffer) -> FrameInfo: ...
4444
def train_dict(samples: Iterable[ReadableBuffer], dict_size: int) -> ZstdDict: ...
4545
def finalize_dict(zstd_dict: ZstdDict, /, samples: Iterable[ReadableBuffer], dict_size: int, level: int) -> ZstdDict: ...
4646
def compress(
47-
data: ReadableBuffer, level: int | None = None, options: Mapping[int, int] | None = None, zstd_dict: ZstdDict | None = None
47+
data: ReadableBuffer,
48+
level: int | None = None,
49+
options: Mapping[int, int] | None = None,
50+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
51+
) -> bytes: ...
52+
def decompress(
53+
data: ReadableBuffer, zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None, options: Mapping[int, int] | None = None
4854
) -> bytes: ...
49-
def decompress(data: ReadableBuffer, zstd_dict: ZstdDict | None = None, options: Mapping[int, int] | None = None) -> bytes: ...
5055
@final
5156
class CompressionParameter(enum.IntEnum):
5257
compression_level = _zstd.ZSTD_c_compressionLevel

stdlib/compression/zstd/_zstdfile.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ZstdFile(_streams.BaseStream):
3636
*,
3737
level: None = None,
3838
options: Mapping[int, int] | None = None,
39-
zstd_dict: ZstdDict | None = None,
39+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
4040
) -> None: ...
4141
@overload
4242
def __init__(
@@ -47,7 +47,7 @@ class ZstdFile(_streams.BaseStream):
4747
*,
4848
level: int | None = None,
4949
options: Mapping[int, int] | None = None,
50-
zstd_dict: ZstdDict | None = None,
50+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
5151
) -> None: ...
5252
def write(self, data: ReadableBuffer, /) -> int: ...
5353
def flush(self, mode: _ZstdCompressorFlushBlock | _ZstdCompressorFlushFrame = 1) -> bytes: ... # type: ignore[override]
@@ -71,7 +71,7 @@ def open(
7171
*,
7272
level: None = None,
7373
options: Mapping[int, int] | None = None,
74-
zstd_dict: ZstdDict | None = None,
74+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
7575
encoding: str | None = None,
7676
errors: str | None = None,
7777
newline: str | None = None,
@@ -84,7 +84,7 @@ def open(
8484
*,
8585
level: int | None = None,
8686
options: Mapping[int, int] | None = None,
87-
zstd_dict: ZstdDict | None = None,
87+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
8888
encoding: str | None = None,
8989
errors: str | None = None,
9090
newline: str | None = None,
@@ -97,7 +97,7 @@ def open(
9797
*,
9898
level: None = None,
9999
options: Mapping[int, int] | None = None,
100-
zstd_dict: ZstdDict | None = None,
100+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
101101
encoding: str | None = None,
102102
errors: str | None = None,
103103
newline: str | None = None,
@@ -110,7 +110,7 @@ def open(
110110
*,
111111
level: int | None = None,
112112
options: Mapping[int, int] | None = None,
113-
zstd_dict: ZstdDict | None = None,
113+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
114114
encoding: str | None = None,
115115
errors: str | None = None,
116116
newline: str | None = None,

stdlib/tarfile.pyi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ class TarFile:
214214
errorlevel: int | None = ...,
215215
level: None = None,
216216
options: Mapping[int, int] | None = None,
217-
zstd_dict: ZstdDict | None = None,
217+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
218218
) -> Self: ...
219219

220220
@overload
@@ -355,7 +355,7 @@ class TarFile:
355355
debug: int | None = ...,
356356
errorlevel: int | None = ...,
357357
options: Mapping[int, int] | None = None,
358-
zstd_dict: ZstdDict | None = None,
358+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
359359
) -> Self: ...
360360
@overload
361361
@classmethod
@@ -376,7 +376,7 @@ class TarFile:
376376
debug: int | None = ...,
377377
errorlevel: int | None = ...,
378378
options: Mapping[int, int] | None = None,
379-
zstd_dict: ZstdDict | None = None,
379+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
380380
) -> Self: ...
381381

382382
@overload
@@ -611,7 +611,7 @@ class TarFile:
611611
fileobj: IO[bytes] | None = None,
612612
level: None = None,
613613
options: Mapping[int, int] | None = None,
614-
zstd_dict: ZstdDict | None = None,
614+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
615615
*,
616616
format: int | None = ...,
617617
tarinfo: type[TarInfo] | None = ...,
@@ -631,7 +631,7 @@ class TarFile:
631631
fileobj: IO[bytes] | None = None,
632632
level: int | None = None,
633633
options: Mapping[int, int] | None = None,
634-
zstd_dict: ZstdDict | None = None,
634+
zstd_dict: ZstdDict | tuple[ZstdDict, int] | None = None,
635635
*,
636636
format: int | None = ...,
637637
tarinfo: type[TarInfo] | None = ...,

stubs/networkx/METADATA.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version = "3.6"
1+
version = "3.6.1"
22
upstream_repository = "https://github.com/networkx/networkx"
33
# requires a version of numpy with a `py.typed` file
44
requires = ["numpy>=1.20"]

stubs/networkx/networkx/algorithms/bipartite/matrix.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,11 @@ def biadjacency_matrix(
1616
format="csr",
1717
): ... # Return is a complex union of scipy classes depending on the format param
1818
@_dispatchable
19-
def from_biadjacency_matrix(A, create_using: Graph[_Node] | None = None, edge_attribute: str = "weight"): ...
19+
def from_biadjacency_matrix(
20+
A,
21+
create_using: Graph[_Node] | None = None,
22+
edge_attribute: str = "weight",
23+
*,
24+
row_order: Iterable[Incomplete] | None = None,
25+
column_order: Iterable[Incomplete] | None = None,
26+
): ...

stubs/networkx/networkx/algorithms/community/__init__.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from networkx.algorithms.community.asyn_fluid import *
2+
from networkx.algorithms.community.bipartitions import *
23
from networkx.algorithms.community.centrality import *
34
from networkx.algorithms.community.community_utils import *
45
from networkx.algorithms.community.divisive import *
56
from networkx.algorithms.community.kclique import *
6-
from networkx.algorithms.community.kernighan_lin import *
77
from networkx.algorithms.community.label_propagation import *
88
from networkx.algorithms.community.leiden import *
99
from networkx.algorithms.community.local import *
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from _typeshed import Incomplete
2+
from collections.abc import Iterable
3+
4+
from networkx.algorithms.shortest_paths.weighted import _WeightFunc
5+
from networkx.classes.graph import Graph, _Node
6+
from networkx.utils.backends import _dispatchable
7+
from numpy.random import RandomState
8+
9+
__all__ = ["kernighan_lin_bisection", "spectral_modularity_bipartition", "greedy_node_swap_bipartition"]
10+
11+
@_dispatchable
12+
def kernighan_lin_bisection(
13+
G: Graph[_Node],
14+
partition: tuple[Iterable[Incomplete], Iterable[Incomplete]] | None = None,
15+
max_iter: int = 10,
16+
weight: str | _WeightFunc[_Node] = "weight",
17+
seed: int | RandomState | None = None,
18+
) -> tuple[set[Incomplete], set[Incomplete]]: ...
19+
def spectral_modularity_bipartition(G: Graph[_Node]) -> tuple[set[Incomplete], set[Incomplete]]: ...
20+
def greedy_node_swap_bipartition(
21+
G: Graph[_Node], *, init_split: tuple[set[Incomplete], set[Incomplete]] | None = None, max_iter: int = 10
22+
) -> tuple[set[Incomplete], set[Incomplete]]: ...

0 commit comments

Comments
 (0)