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
This reverts commit 034cfab4d6.
The commit exposed the value of the compression constants, which seem
to be implementation details, in the public API. I don't see anything
in the documentation about the values of the constants such as
`ZIP_STORED`:
https://docs.python.org/3/library/zipfile.html?highlight=zipfile#zipfile.ZipFile
Example where this makes a difference:
```
from typing import Literal
import zipfile
def f1(p: str, compression: int) -> None:
"""Error: compression should have the type Literal[0, 8, 12, 14]"""
zipfile.ZipFile(p, compression=compression)
def f2(p: str, compression: Literal[0, 8, 12, 14]) -> None:
"""Works, but cryptic and exposes internal implementation details"""
zipfile.ZipFile(p, compression=compression)
```
The values are of constants need to be explicitly specified if somebody
wants to wrap `zipfipe.ZipFile`, which arguably exposes implementation
details in a problematic fashion.
Here is a real-world example where this caused a regression:
https://github.com/pytorch/vision/blob/main/torchvision/datasets/utils.py#L301
Technically some uses of `pwd` accept more types, but others
use `isinstance()` to enforce only `bytes`. It seems better to
keep the same type throughout the module.
* run script and do some manual changes (Akuli)
* do the whole thing manually (srittau)
* merge changes (Akuli)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>