* asyncio: remove BaseChildWatcher from top level
* asyncio.sleep: loop is keyword-only
* asyncio: remove Server from top level
* asyncio: add FastChildWatcher to top level
* asyncio.constants: fix version availability
* asyncio: fix arg name for _wakeup
* asyncio: fix arg name for wrap_future
* asyncio.streams: add Optional to various arguments
It might be possible to further improve some of these with overloads.
* stubtest: fix whitelist
Co-authored-by: hauntsaninja <>
* Use IO[bytes] instead of BytesIO for wave input signatures as it is the (slightly) more general type.
* add missing import
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
The PR #2740 added __setattr__ and __getattr__ to the
werkzeug.wrappers.BaseRequest definition to silence mypy when
monkeypatching this class.
The change disabled the errors for monkeypatching, but disabled disabled the
important check attr-defined.
* flake8 updates and cleanups
* Update to flake8 3.7.9.
* Update to flake8-bugbear 20.1.4.
* Only ignore errors in stub files.
* Remove obsolete error counts.
* Sort error codes alphabetically.
* Don't ignore the following errors (unneeded):
* E704 Multiple statements on one line (def)
* W504 Line break occurred after a binary operator
* B303 __metaclass__ used
* Remove obsolete comment
* Ignore F822 undefined name in __all__
* typing: fix argument names of cast
* typing: use private _Alias class
For py37 and above, this is _GenericAlias, for py36 and below it's
_TypeAlias. I don't think we need to make typing.pyi definitions
correspond more precisely, but we should avoid leaking a
typing.TypeAlias class
- connect_accepted_socket isn't a member of AbstractEventLoop, only
BaseEventLoop
- fix types of arguments with defaults. some of these functions could
have their signatures improved with overloads to reduce false negatives
- correctly mark a positional-only argument
- remove abstractmethod from methods that don't have abstractmethod and
go unimplemented in practice
the `rfile` and `wfile` members are already implemented by
StreamRequestHandler. In addition to them several (undocumented)
class and instance variables exist according to
<https://github.com/python/cpython/blob/master/Lib/socketserver.py#L742>:
- `rbufsize`
- `wbufsize`
- `timeout`
- `disable_nagle_algorithm`
- `packet` and `socket` for datagrams
The already exist with Python 2.7
<https://github.com/python/cpython/blob/2.7/Lib/SocketServer.py#L677>
```mermaid
classDiagram
BaseRequestHandler <|-- DatagramRequestHandler
BaseRequestHandler <|-- StreamRequestHandler
StreamRequestHandler <|-- BaseHTTPRequestHandler
```
Allow passing proper metadata to Distribution.from_location() and
Distribution.from_filename().
Correct the order of arguments for the importer functions.
Note that some functions accept any iterables, not just sized ones.
Correct the type of the VersionConflict classes' context.
The Python source (Objects/exceptions.c) explicitly checks for null
pointers before using the filename and lineno members. Some libraries,
e.g. pkg_resources, set filename and lineno to undefined values if
indeed none are appropriate.
It doesn't actually have __call__, it does some descriptor stuff, but
this makes things work. _SingleDispatchCallable has a __call__ too,
which is what this mirrors.
Fixes#3898