Sebastian Rittau
Sebastian Rittau
Option 3 looks clearer to me in function annotations, but I don't know if there should be separate styles for function arguments and other annotations.
Building on @suriyanto's solution, here is what I've come up with so far (Python 3.10+, but easily adaptable to older versions): ```python def selected_fields(info: GraphQLResolveInfo) -> list[str]: names: list[str] =...
Weird primer output. In the first failure, it seems that the first overload matches: ``` urllib3 (https://github.com/urllib3/urllib3) + test/test_queue_monkeypatch.py:25: error: No overload variant of "object" of "_patcher" matches argument types...
The primer problems seem due to a mypy bug: python/mypy#7781.
I agree. I marked this PR as "deferred" for now.
Fixed in python/mypy#13482, so should be part of the next mypy release.
I don't think we can really do anything in typeshed. This is best handled on the type checker level.
A typing feature that allows stubs to register a type with another type, similar to what abcs provide at runtime, would be useful for those legacy features, though.
Shouldn't we at least add `Literal[False]` to the return type of `IOBase.__exit__()`?
@mrkmndz I assume pyre already supports these?