From the docstring for Template: "Template objects created from the
constructor rather than an environment do have an `environment`
attribute that points to a temporary environment ..."
* requests: allow strings in Session.verify
Per the documentation[1] (and actual usage), the verify parameter can be a
string or a bool.
[1] http://docs.python-requests.org/en/master/user/advanced/#ssl-cert-verification
* requests: explicitly support AuthBase for Session.auth
According to the documentation, the auth parameter should be an AuthBase
subclass[1]. In practice, the actual requirement seems to just be a
Callable[[Request], Request], and AuthBase implements that with the __call__
method. However, mypy isn't currently smart enough to infer that __call__
implies Callable[2]. In the interim (and perhaps also to add clearer errors),
explicitly support AuthBase.
Additionally, this adds typing of AuthBase.__call__, to match the
Callable[[Request], Request] declaration used elsewhere.
[1] http://docs.python-requests.org/en/master/user/advanced/#custom-authentication
[2] https://github.com/python/mypy/issues/797
* Added missing annotation for start_color() and wrapper() functions
* 1) Changed Optional types to be optional arguments (checked documentation and manual experiments to make sure I was doing it right)
2) Modified format to match CONTRIBUTING.md conventions
3) corrected a few missing return types or other mistaken type
annotations
* Allow `requests.post` to accept `Dict[str, str]` for `data`.
For example:
```python
import requests
requests.post('https://www.foo.bar', data={'hello': 'world'})
```
Failes to type check in Python 2 even though it's fine.
* Explode str/Text combinations
* Fix lint
* Simplify iterable parameter for data
* Make requests.Response.iter_content allow None
According to the docstring:
> chunk_size must be of type int or None
* Combine and alphabetize import statement
* Extract WSGIEnvironment in wsgiref.types
* Change value type of WSGIEnvironment to Any
Per PEP 3333, a WSGI environment can contain anything, not just strings.
The missing colon in the variable type annotation means that the type of stream is currently incorrectly determined to be of type ellipsis, rather than IO[str].
All of these files can not be used with pytype at HEAD. They fail during import with various error messages. Make the test script actually load the files and all dependencies of it, instead of just verifying that it can be parsed.
This list was generated by running pytype with more options.
1: typeshed-location was pointed to the current typeshed instead of the one shipped with pytype.
2: --module-name=<foo> was provided as a parameter. Without this parameter wildcard imports "from _ast import *" misbehave.
Files with a "# parse only" comment will only be parsed and not loaded.