I found some code that called DEFINE_integer() and DEFINE_float() with default set to None. Perusing the code that seems to be a totally valid usage. I am not super familiar with gflags but I believe this PR consistently changes all those default values to Optional[].
Make the Python 2 and 3 concurrent.futures stubs identical so fixes get
applied to both.
For example, #1305 and #2233 fixed the same problem at different times,
as did #1078 and #1911.
By making the stubs identical, we apply the fix from #1711 to Python 2.
Fixes#2234.
Use parameterized types in Future.add_done_callback(), wait(), and
as_completed().
Mark the traceback argument to Future.set_exception_info() as optional.
The Python 2 version was slightly outdated compared to the Python 3
version.
The Python 2 version of Headers.__delitem__() had an optional argument
_index_operation that also exists in the implementation. But considering
this is internal use only, it was missing from the Python 3 version, and
it created problems with derived classes, I decided not to add it to
the merged stub. See also pallets/werkzeug#1051.
* Move google protobuf from 2 to 2and3
This should generally be ok. I ran the internal consistency
tests and they seemed to pass.
* Convert str to bytes
* repr to use str in google.protobuf.internal.containers
To support "from six.moves.cPickle import loads", we must add a stub for
six.moves.cPickle as if it were a real submodule, even though it isn't
implemented as such. This fixespython/mypy#1550.
We don't apply this approach to six.moves.builtins on Python 2, because
it seems to confuse mypy.
We also add stubs for aliases in six.moves whose underlying modules have
been added to typeshed.
For Python 2:
- six.moves.SimpleHTTPServer (alias for SimpleHTTPServer)
For Python 3:
- six.moves.tkinter_dialog (alias for tkinter.dialog)
- six.moves.tkinter_filedialog (alias for tkinter.filedialog)
- six.moves.tkinter_commondialog (alias for tkinter.commondialog)
- six.moves.tkinter_tkfiledialog (alias for tkinter.filedialog)
Currently the Python 2 stub for `IntEnum` just inherits from `Enum` without changing anything, meaning that its `value` has type `Any`. This changes it such that, if you know you have an `IntEnum` you get the more specific `int` type for the `value`. Note that this has already been done for Python 3 `IntEnum` (both in `third_party/3/enum.pyi` and `stdlib/3.4/enum.pyi`).
This fixes an error in Travis that seems to have been caused by python/mypy#4319.
The fix was taken from the stdlib/3.4/enum.pyi stub. Mypy no longer assumes
that classes whose metaclass is EnumMeta are subclasses of Enum, so we can't
bound the typevar on Enum.
* 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