Commit Graph

7 Commits

Author SHA1 Message Date
Shantanu
22fd5e916a wsgiref: fix arg name, make close an instance variable (#4123)
Co-authored-by: hauntsaninja <>
2020-05-27 21:06:11 -07:00
Sebastian Rittau
6d6894e1ef Annotate werkzeug wrap_file() and FileWrapper (#2519)
* Add FileWrapper protocol to wsgiref.types

* Annotate werkzeug's wrap_file and FileWrapper

* Remove empty line at end of file

* Fix _Readable protocols
2018-10-23 13:43:53 +02:00
Sebastian Rittau
25ac4d6af4 Implement StartResponse using a protocol (#2392)
* Add ExcInfo and OptExcInfo type aliases

* Implement StartResponse using a protocol

* Mark stub-only types with an underscore

* Remove wrong TODO note

python/mypy#1178 is about variable-length tuples, while exc_info()
always returns a tuple with length 3. Ideally, exc_info() would
return Union[Tuple[Type[_E], _E, TracebackType], Tuple[None, None, None]],
but that is a different issue.
2018-08-17 08:36:00 -07:00
Sebastian Rittau
f25c9548ed Replace StartResponse arguments with ... (#2379)
StartResponse callbacks are required to accept and optional third argument.
Currently, there is no good way to describe this using type hints.
Previously, a Union was used, but that causes mypy to complain about any call
of start_response().
2018-08-15 10:41:39 -07:00
Sebastian Rittau
b1cd9fedf8 Complete wsgiref (#2165)
* Add wsgiref.handlers

* Add wsgiref.simple_server
2018-05-28 08:08:27 -07:00
Sebastian Rittau
8b84e9cf13 Improve wsgiref stubs (#2145)
* Use typing.Text

* Add InputStream and ErrorStream WSGI protocols

* Fix return type of WSGIApplication

* Add type hints to wsgiref.validate

* Replace _Bytes by plain bytes

* Add wsgiref.util

* Add wsgiref.headers

* ErrorWrapper.writelines() takes an Iterable

* Fix start_response return type
* Make Python 2 and 3 branches resemble each other more closely
* Use typing.NoReturn
* Fix WriteWrapper.writer type

* Change return type of WriteWrapper.writer to Any
2018-05-23 08:19:07 -07:00
Sebastian Rittau
09008599ce Merge Python 2 and 3 wsgiref (#2106)
* Merge Python 2 and 3 wsgiref

* Move wsigref to 2and3
2018-05-09 16:26:03 -07:00