This removes the circular dependency between the os and posix stub, which
is somehow triggering python/mypy#4442. We should ideally fix the mypy bug,
but since it's easy enough to fix the import cycle, we might as well do that
too.
* Have Element inherit from MutableSequence, which is more precise than Sequence.
* Remove unnecessary inherited methods (e.g., __getitem__).
* Correct extend() to take an Iterable. (Sequence was too specific.)
* Alphabetize the typing imports, for sanity.
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.