Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created May 15, 2024 11:10
Show Gist options
  • Save mypy-play/b1c45bb19686f0aa286747733542b47d to your computer and use it in GitHub Desktop.
Save mypy-play/b1c45bb19686f0aa286747733542b47d to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from typing import TypeVar, Generic
T = TypeVar("T")
class W(Generic[T]):
def managed(self) -> T:
raise NotImplementedError
class MW(Generic[T]):
def __init__(self, w: T) -> None:
...
class A(Generic[T], W[AM[T]]): pass
class AM(Generic[T], MW[A[T]]):
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment