We recently cut a new-ish release of typed-ast that [adds a new field][0]
named `kind` to the `ast27.Str` and `ast3.Str` classes. This field
stores whatever string modifiers (like `b` or `u`) were present on the
original string.
As a note, I've confirmed that this field is indeed a str (and not
bytes) for ast27's Str class.
[0]: https://github.com/python/typed_ast/pull/49
For now specify Requirement.marker as Optional[Any] (as suggested by @srittau)
as we can't import packaging.markers (pkg_resource does that via runtime magic
in pkg_resources.external)
Closes#2961
All Python 3 versions supported by typeshed (3.4+) have enum as part
of the standard library.
Make the third-party Python 2 version consistent with the Python 3 version.
* pkg_resources.Distribution: Fix self arguments
* docutils: Remove spurious ellipses
* Add self argument to markupsafe.Markup.format()
While the actual signature is also "def format(*args, **kwargs)", the
implementation extracts "self" from "args" as first step.
* werkzeug: Remove methods not present during runtime
UpdateDictMixin.calls_update() and EnvironBuilder.form_property()
get deleted while constructing the respective class.
* requests: Add missing self argument
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.
Basically, the same thing as [my previous pull request][0], except the
fixes are now focusing on functions with overlapping argument counts.
[0]: https://github.com/python/typeshed/pull/2138
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)