`@trait` has special meaning to the experimental mypyc compiler,
slightly restricting the behavior of the class in exchange for
allowing it to be multiply inherited from.
pathlib2 is the Python 2.7 backport of the pathlib module from Python 3.
Hence we use the same stub file for both.
The maintainer of pathlib2 granted permission for stubs to be added in
mcmtroffaes/pathlib2#44.
* pkg_resources.Distribution: Fix self arguments
* docutils: Remove spurious ellipses
* Add self argument to markupsafe.Markup.format()
While the actual signature is also "def format(*args, **kwargs)", the
implementation extracts "self" from "args" as first step.
* werkzeug: Remove methods not present during runtime
UpdateDictMixin.calls_update() and EnvironBuilder.form_property()
get deleted while constructing the respective class.
* requests: Add missing self argument
Click already had stubs but not for the `testing` submodule.
I used stubgen and then narrowed the types when it was easy. I left
`Any` where more work was necessary.
I found some code that called DEFINE_integer() and DEFINE_float() with default set to None. Perusing the code that seems to be a totally valid usage. I am not super familiar with gflags but I believe this PR consistently changes all those default values to Optional[].
The change introduced in 395ab5abd1
broke the signature of `requests.post`, among others, since
`MutableSequence` is invariant, and plain `Dict[str, str]` values
were no longer valid for the `data` argument.
This changes the signature to have `Any` components as a
compromise. Adding more items to the union seems a bit too much, since
the error messages for invalid argument types are already pretty hard to
read.
Another option might be to use `Mapping` instead of `MutableMapping`
due to covariance, but I assume there's a reason why `MutableMapping`
is used here.
The previous definitions in `mock` caused many false positives in
internal Dropbox repositories.
One source of problems was `List[Mock]` not being compatible with
`List[SomeClass]`, since `list` is invariant.
Make the Python 2 and 3 concurrent.futures stubs identical so fixes get
applied to both.
For example, #1305 and #2233 fixed the same problem at different times,
as did #1078 and #1911.
By making the stubs identical, we apply the fix from #1711 to Python 2.
Fixes#2234.
Use parameterized types in Future.add_done_callback(), wait(), and
as_completed().
Mark the traceback argument to Future.set_exception_info() as optional.
This additionally allows strings, bytearrays and string iterables to be
passed as the `response` argument of `BaseResponse` (and thus also
`Response`).
Strings and bytearrays are explicitly handled in `__init__` [1].
Strings are also featured on the Werkzeug front-page snippet (`'Hello
World!'`) [2].
[1]: d129d17066/werkzeug/wrappers.py (L861)
[2]: http://werkzeug.pocoo.org/