Details
-
Suggestion
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.x
-
None
Description
So, I have a Protocol class named Game:
from typing import Any, Protocol class Game(Protocol): """Protocol for implementing a specific chess game.""" move_played: Any # ClassVar[Signal[Move]] (Move is from python-chess library)
There's no way to annotate my move_played signal so that mypy would be happy. I thought ClassVar[Signal] would be okay, but no such luck. Also, I'd like to annotate that the instance of Signal will carry a Move object.
The concrete class defines it like this:
class ClassicGame(QObject): """Implementation of a classic chess game.""" move_played: Signal = Signal(Move)
Please help me add a proper type hint to my move_played custom signal in my Protocol class.
Please note that
ClassVar[Signal] = ...
is also fruitless.
Attachments
Issue Links
- relates to
-
PYSIDE-3012 QtCore.pyi: Improving type annotations
-
- Open
-