Created
March 9, 2026 19:04
-
-
Save mypy-play/2d99b0f746d714cd27da4ba85e0ae52e to your computer and use it in GitHub Desktop.
Shared via mypy Playground
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
| from typing import Protocol, Self | |
| class FloatScalar[FloatT](Protocol): | |
| def pow(self, arg: FloatT) -> Self | complex: ... | |
| def upcast(arg: FloatScalar[object]) -> FloatScalar[float]: | |
| return arg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment