typeshed
typeshed copied to clipboard
Collection of library stubs for Python, with static types
`__eq__`'s type hint for primitives accept `object` while in many cases it returns `NotImplemented`
As can be seen in [builtins.pyi](https://github.com/python/typeshed/blob/master/stdlib/builtins.pyi), all primitives are defining their `__eq__` and `__ne__` functions in the following manner: ```python def __eq__(self, __x: object) -> bool: ... def __ne__(self, __x:...
We currently silence many errors from socket constants in stubtest, because the availability of some constants cannot be expressed in the type system (and probably also because historically we weren't...
re-try of #2772 / #2773
Since version 3.4, the cryptography library itself ships with type hints: https://cryptography.io/en/latest/changelog/#v3-4 This is the first step for #5618. Currently, if I use `types-paramiko` and `cryptography`, it forces me to...
Given the following code snippet: ```py buf = b"abcdefg" view = memoryview(buf).cast("c") for c in view: print(type(c)) if c == b"c": print("Found c") ``` Inside the loop, the variable `c`...
A `py.typed` file was just added: https://github.com/afonasev/flake8-plugin-utils/pull/78
I found a problem using `types-redis` library with new redis.asyncio module. The problem is that mypy throws an error. The code: ``` async def get_redis_connection(request: Request) -> AsyncGenerator[Redis, None]: ```...
in order to be more compliant with typing overall
I ran into a case where a user intended to check whether an enum value `x` was present in a dictionary `Dict[int, int]`: `x.value in d`. But instead they wrote...
I just updated MyPy in Jinja, and had to ignore the return type of `sum` in one of my functions because MyPy started saying it wasn't compatible with the `TypeVar`...