* adding ascii, panal and textpad modules to the curses module.
* added curses/panel.pyi and curses/textpad.pyi to test/pytype_blacklist.txt
just like curses/__init__.pyi because they all import _curses. (This
may not be the right thing to do)
Also, change the type of StringIO.name (Python 3) from str to Any.
Neither StringIO nor BytesIO actually define a name field, but the
super-class IO[T] of both in typeshed does define a read-only property.
This means that sub-classes of StringIO and BytesIO adding this field
will not typecheck correctly.
Closes: #1790
* Fix werkzeug environ type
PEP 3333 explicitly calls for environ to be a built-in dict. Using a
Mapping will not only prevent the dict from being modified (which is
explicitly allowed by PEP 3333), it will also cause interaction
problems when the environment is passed to other WSGI handlers.
Also change the value type from object to Any for convenience. By
definition, the values can be anything and can't be type checked.
Using object instead of Any forces us to explicitly cast the value
whenever we access it.
* Use Union[str, unicode] for Werkzeug environment keys
This matches the type in wsgiref.types.
* Use WSGIEnvironment from wsgiref.types
* Add '= ...' to environ attribute
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