Merged
Conversation
I got the argument order from https://github.com/python/cpython/blob/2bfc2dc214445550521074f428245b502d215eac/Objects/codeobject.c#L263 and the types from the attributes already in the stub.
* StrictRedis is an alias for Redis in current redis * Add a few types * Add missing import * Add missing argument and types
The marshal.dumps and marshal.loads functions should return and accept bytes, respectively, rather than a string.
This includes two things to sync up with recent runtime updates: * Move `Final`, `@final`, `Literal`, and `TypedDict` to `typing` (`typing_extensions` still defines or re-exports them) * Rename `@typing.runtime` to `@typing.runtime_checkable`, while keeping `@runtime` as a backwards-compatible alias in `typing_extensions`.
The Pull Request #1121 added the `AddressFamily` type to `socket.pyi` for Python 3.4+, so constants such as `AF_INET` are correctly represented as being an enum member rather than an int. The same is true of the `SocketKind` enums in the `SOCK_*` family. Various functions in the socket module can accept either an int or an `AF_*` enum member as arguments, which is allowed by the int argument type. However the `getaddrinfo` function returns an `AddressFamily` member rather than an int in the first position of its list members, so code that access enum specific members such as the `name` attribute causes a typing error to be found. This change corrects the return type of `getaddrinfo` but leaves the family parameters as int, given that `AddressFamily` members are `IntEnum` and only ever treated as `int`s internally.
Morsel does cast any value to string and therfor any is the correct typehint. For some keys other types then strings are more appropiate anyway, max-age can take an integer (unix time) and http-only a boolean. Closes #3059
* Add types and functions in types.py that are new in 3.7 * Update `resolve_bases` to accept any iterable of objects, and the same for `new_class` if the version is at least 3.7 * Add comparison overrides implemented by MethodWrapperType * Fix mypy error due to over-constrained `__eq__`
…3085) Both are None if there were no groups matched. Also 'lastgroup' will be None if the matched group was nameless. The Python 2 versions of these annotations already used Optional.
This removes the indirection of setting environment variables to install and run tests. Also, use an explicit version for running mypy with typed-ast.
Modified __add__ method in tuple class to allow it to accept tuples with different generic parameter types. This allows, for example: a = (1, ) b = a + (2.4, )
…3294) This was discussed in #3181 and the correct explanation was given that object ought to be preferred here. In practice this caused an obscure issue with mypy when using this operations on the results of six.viewkeys(), since it decided that it wanted a mapping *from* object as a result of inference contexts. Grumble.
PR #3269 added some version checks for the argument type to setLevel and the existence of NullHandler. While these features weren't present in early versions of Python 3, they *are* present in Python 2.7, which leads to false positives.
This is important because mypy doesn't generally think functions are compatible with `FunctionType`, so `inspect.getsource` on arbitrary functions is rejected by the current annotations.
…vate_key. (#3296) The only extant implementation of generate_private_key returns this more specialized interface.
The cryptography stubs are very rudimentary at the moment, but there is nothing that limits them to just Python 2. Closes: #3303
* In Python 2, the optional `msg` argument was missing. * In Python 3, the method was missing altogether. Reference: https://github.com/python/cpython/blob/2.7/Lib/_pyio.py#L423 https://github.com/python/cpython/blob/3.6/Lib/_pyio.py#L443
The decode method of IncrementalNewlineDecoder accepts a string when its decoder is None.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.