Type Notation for Generic which inherits from (or is) `T`

Hey folks,

I currently have a class decorator which will bootstrap a defined class with a set of attributes & methods, i.e.:

from typing import Callable, Generic, TypeVar

T = TypeVar("T")

class Bootstrapped(Generic[T]):
    myattr: str
    mymethod: Callable[[T], str]

def bootstrap(cls: T) -> Bootstrapped[T]:
    # impl here

AFAICT, the closest thing I can do is a Union[T, Bootstrapped[T]]. This at least stops type-checkers from complaining, but it’s not really correct, as we’re notating with that annotation that the type is either T or Bootstrapped[T]. What I want is a notation which can say the type is both T and Bootstrapped[T].

Anyone have thoughts on how this may be accomplished without writing a custom plugin for mypy, etc?

I am also looking for a similar solution, any progress on this?