Skip to content

Conversation

@AlexWaygood
Copy link
Member

This comment states that this class fails at runtime, but that isn't true:

>>> from typing import *
>>> T_co = TypeVar("T_co")
>>> class Proto2(Protocol[T_co], Generic[T_co]): ...
... 
>>>

The comment should instead quote the spec here, which states that type checkers should consider it an error (even though it does not fail at runtime)

This comment states that this class fails at runtime, but that isn't true:

```pycon
>>> from typing import *
>>> T_co = TypeVar("T_co")
>>> class Proto2(Protocol[T_co], Generic[T_co]): ...
... 
>>>
```

The comment should instead quote the spec [here](https://typing.python.org/en/latest/spec/protocol.html#generic-protocols), which states that type checkers should consider it an error (even though it does not fail at runtime)
@AlexWaygood AlexWaygood added the topic: conformance tests Issues with the conformance test suite label Jan 29, 2026
@AlexWaygood AlexWaygood changed the title [conformance suite] Fix inaccurate comnent in protocols_generic.py [conformance suite] Fix inaccurate comment in protocols_generic.py Jan 29, 2026
@AlexWaygood AlexWaygood merged commit 08f929b into main Jan 29, 2026
5 checks passed
@AlexWaygood AlexWaygood deleted the alex/protocols-generic-comment branch January 29, 2026 21:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

topic: conformance tests Issues with the conformance test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants