* 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.
We recently cut a new-ish release of typed-ast that [adds a new field][0]
named `kind` to the `ast27.Str` and `ast3.Str` classes. This field
stores whatever string modifiers (like `b` or `u`) were present on the
original string.
As a note, I've confirmed that this field is indeed a str (and not
bytes) for ast27's Str class.
[0]: https://github.com/python/typed_ast/pull/49
For now specify Requirement.marker as Optional[Any] (as suggested by @srittau)
as we can't import packaging.markers (pkg_resource does that via runtime magic
in pkg_resources.external)
Closes#2961
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.
All Python 3 versions supported by typeshed (3.4+) have enum as part
of the standard library.
Make the third-party Python 2 version consistent with the Python 3 version.
* 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.