Commit Graph

88 Commits

Author SHA1 Message Date
Alex Waygood
53747b264e Stdlib: add 'obvious' default values (#9688) 2023-02-07 13:00:40 +01:00
Alex Waygood
0ef9c3f8e8 Enable flake8-pyi's Y037 (#9686) 2023-02-06 19:01:02 -08:00
Jelle Zijlstra
0fc3a567fc stdlib: add defaults for modules accessible on MacOS (#9659)
Ran stubdefaulter with standard options on a Mac.
2023-02-01 22:46:55 +00:00
Jelle Zijlstra
bc463a0677 Remove default for size parameter to multiprocessing.heap.Heap (#9658)
It's system-dependent. stubdefaulter told me `multiprocessing.heap.Heap: parameter size: stub default 4096 != runtime default 16384`, which presumably means it's 4096 on @AlexWaygood's system and 16384 on mine. I looked in the code and the default is set to `mmap.PAGESIZE`, which in turn is set from some system call at import time.
2023-02-01 22:43:50 +00:00
Alex Waygood
33a62ae42d Add more defaults to the stdlib (#9606)
Continuing work towards #8988.

The first five commits were created using stubdefaulter on various Python versions; the following commits were all created manually by me to fix various problems. The main things this adds that weren't present in #9501 are:

- Defaults in Windows-only modules and Windows-only branches (because I'm running a Windows machine)
- Defaults in non-py311 branches
- Defaults for float parameters
- Defaults for overloads
2023-01-29 01:51:23 +00:00
Alex Waygood
d98d1674e7 Fix a few issues with parameter defaults (#9572) 2023-01-20 09:47:59 -08:00
Jelle Zijlstra
ddfaca3200 stdlib: add argument default values (#9501) 2023-01-18 09:37:34 +01:00
Avasam
c70d303985 Audit stdlib object annotations (#9519) 2023-01-17 15:40:00 +00:00
Avasam
aad1a14890 Use the FileDescriptorOrPath alias consistently in the stdlib (#9513) 2023-01-12 18:14:48 +00:00
Mike Placentra
89fb1d5521 fix type for multiprocessing.log_to_stderr(): allow int level (#9334)
Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
2022-12-05 22:44:26 +00:00
Nikita Sobolev
e1aa4d5285 Add types to multiprocessing/reduction.pyi (#9171) 2022-11-22 14:02:14 +00:00
Jelle Zijlstra
7299b07790 multiprocessing: improve bytes handling (#9085) 2022-11-04 10:58:58 +01:00
Nikita Sobolev
380022c650 Remove empty __init__ methods (#8816) 2022-09-30 13:08:41 +01:00
Alex Waygood
deff426b6f Fix multiprocessing.DictProxy.values() (#8815)
Fixes #8814
2022-09-30 13:37:53 +02:00
Jukka Lehtosalo
e4d0d3d9d7 Make the return type of multiprocessing.connection.Pipe more precise (#8706)
The precise return type depends on the platform. Link to implementation:
68fb03249f/Lib/multiprocessing/connection.py (L518)

Now users no longer need to use the internal-looking class
`_ConnectionBase` in annotations, at least in code that doesn't
need to be cross-platform.
2022-09-08 13:24:49 +01:00
Nikita Sobolev
6e985ef3de stdlib mapping classes: Use better names for various pos-only parameters (#8637) 2022-08-28 23:29:00 +01:00
Nikita Sobolev
0259068ad6 Remove duplicate definitions in sub-classes (#8594) 2022-08-26 17:10:55 +02:00
Alex Waygood
c2966bc5ed multiprocessing.reduction: Any -> Incomplete (#8585) 2022-08-21 17:43:55 -07:00
Nikita Sobolev
510feeb3fc Improve constructor for builtins.dict (#8517)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-08-10 19:04:07 +01:00
Nikita Sobolev
ac86defef7 Simplify multiprocessing.context.{SpawnProcess,SpawnContext} (#8499) 2022-08-06 12:03:43 +01:00
Alex Waygood
892796a794 Remove, move or # noqa more TypeAlias declarations (#8450) 2022-08-05 13:03:19 +01:00
Nikita Sobolev
799fd2c8d8 Improve multiprocessing.context module (#8466)
* Use `ClassVar` where applicable
* Fix `_Popen()` return types
* Remove non-existing field `BaseContext.Process`

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-08-04 12:30:23 +02:00
Kevin Kirsche
f550c24886 Add multiprocessing.popen_spawn_win32 submodule (#8428) 2022-07-29 16:02:15 +01:00
Kevin Kirsche
17e3cf99a4 Add multiprocessing.popen_spawn_posix submodule (#8427) 2022-07-29 15:52:49 +01:00
Kevin Kirsche
1f0e641521 Add multiprocessing.popen_forkserver submodule (#8425)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-07-28 17:26:06 +01:00
Alex Waygood
a9f6632d1b multiprocessing.reduction: improve recvfds and recv_handle (#8422) 2022-07-28 17:05:08 +01:00
Alex Waygood
26d09359cf multiprocessing.resource_sharer: remove unused TypeAlias (#8424) 2022-07-28 17:43:36 +02:00
Kevin Kirsche
fe1e3ef91b Add multiprocessing.heap submodule (#8412)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-07-28 16:27:25 +01:00
Kevin Kirsche
087fb6b96d Add multiprocessing.popen_fork submodule (#8420)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-07-28 16:19:43 +01:00
Kevin Kirsche
dd24bba3dd Add multiprocessing.resource_sharer submodule (#8413)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-07-28 16:09:18 +01:00
Kevin Kirsche
48e502c431 fix: Add missing multiprocessing.util types (#8404)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-07-27 20:22:54 +01:00
Kevin Kirsche
5397d430ea Add multiprocessing.resource_tracker submodule (#8405) 2022-07-27 17:31:31 +01:00
Kevin Kirsche
a0c1a2f566 Add multiprocessing.forkserver submodule (#8406)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2022-07-27 17:08:12 +01:00
Shantanu
f76c6ed55a multiprocessing: make some overloads more precise (#8330)
See discussion here: https://github.com/python/typeshed/issues/4266#issuecomment-1187867029

Co-authored-by: hauntsaninja <>
2022-07-19 16:55:23 +01:00
Alex Waygood
edc0ecd857 Remove Python 3.6 branches from typeshed (#8269) 2022-07-11 10:55:17 +02:00
Alex Waygood
a2e8346d9a Improve multiprocessing stubs (#8202)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-07-01 23:50:39 +05:30
Alex Waygood
ca44b893e3 multiprocessing: audit callback annotations (#8178) 2022-06-26 13:15:26 +01:00
Alex Waygood
01d5e28ff7 Fix miscellaneous invalid TypeVar usages (#8074) 2022-06-14 08:48:41 -07:00
Alex Waygood
591593c85f Simplify __all__ for modules beginning with 'm' to 't' (#8028) 2022-06-07 20:14:15 +01:00
Alex Waygood
d511312e21 multiprocessing.managers: fix TypeVar usage (#7938)
#7928

`dict()` and `list()` just return empty dictionaries and lists (respectively) if no arguments are supplied:

```python
>>> from multiprocessing.managers import SyncManager
>>> with SyncManager() as s:
...     print(s.dict())
...
{}
```
2022-05-26 07:18:43 -07:00
Jelle Zijlstra
573539ba2a multiprocessing: add shutdown_timeout param to BaseManager (#7692)
python/cpython#32112
2022-04-25 22:12:56 -06:00
Alex Waygood
b093c90a94 Use TypeAlias for type aliases where possible, part II (#7667) 2022-04-20 20:02:47 +01:00
Alex Waygood
97a74bc1aa Import from collections.abc wherever possible (#7635) 2022-04-18 12:50:37 +02:00
Alex Waygood
740193a8fc Use TypeAlias where possible for type aliases (#7630) 2022-04-15 18:01:00 -07:00
Alex Waygood
da3e69d093 stdlib: Improve a bunch of __(a)exit__ methods (#7571) 2022-04-01 08:05:25 +02:00
Rebecca Chen
f39f20c4dd Fix the type signature of multiprocessing.managers.BaseManager.__exit__ (#7529)
All parameters should accept None.
2022-03-22 07:32:15 +01:00
Jelle Zijlstra
ba475a04c3 multiprocessing: args can be any Iterable (#7500)
https://github.com/python/cpython/blob/main/Lib/multiprocessing/process.py#L91
2022-03-17 01:44:25 +00:00
Alex Waygood
3ab250eec8 Use PEP 604 syntax wherever possible (#7493) 2022-03-16 16:01:33 +01:00
Alex Waygood
f4ae363b56 stdlib: correct many pos-or-kw arg names in dunder methods (#7451) 2022-03-07 16:40:03 +01:00
Alex Waygood
947724a5cb stdlib: Add several missing @abstractmethod decorators (#7443) 2022-03-06 16:41:13 -08:00