`dispatch_request` can accept arbitrary arguments and can return
different values. To keep this simple and in line with the rest of the
stubs (e.g. with `view_func: Callable[..., Any]`), `Any` is used for the
return value although it is too broad.
Closes#2795.
* default_exceptions is a dict of classes, not instances
* Correctly overload 'redirect' to get the proper return type
* Request.get_data() is an Any (not bytes), just like Response.get_data
Currently, iter_lines() doesn't have any type annotations despite the types being very similar to iter_content and the types can be pretty readily derived from the source.
This class is not defined at runtime but it's used by
mypy internally to support TypedDict methods.
Use NoReturn in argument types for better type safety
when the related mypy plugin hook is not active.
* Add FileWrapper protocol to wsgiref.types
* Annotate werkzeug's wrap_file and FileWrapper
* Remove empty line at end of file
* Fix _Readable protocols
Based on the pytz docs http://pytz.sourceforge.net/ and code (version
2018.5).
- Accurately model the return value of the `timezone()` function. This
necessitates modeling the internal pytz class hierarchy which is quite
inconsistent.
- Expose `_BaseTzInfo` as `BaseTzInfo`.
This change is useful because this type is importable and otherwise
there is no pytz type which can be used in type annotations, e.g. in a
function which takes a pytz `tzinfo` with the `localize` method,
rather than a general `datetime.tzinfo`.
- Remove the lazy.pyi stubs. The `lazy` module contains some unrelated
general data structures. It is not a public API - it is not documented
and the types are not included in `__all__`.
- Remove methods which are already specified by inheritance in
`datetime.tzinfo`.
- Add several public exception classes.
- Fill in the generic type parameters of the exposed `Dict`/`List`
constants. Also change `Dict` -> `Mapping` because it is not actually
a proper `dict`.
- Some style/ordering improvements.
`@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.