Hi everyone! I'm trying to type a decorator that returns a Wrapper class of another class. The idea is that
I have a wrapper class that only adds a couple of properties to the original class, something like this:
```python
from typing import Type, TypeVar, Generic
_T = TypeVar("_T")
class Wrapper(Generic[_T]):
wrap: Type[_T]
enhanced: bool = True
def __init__(self, cls: Type[_T]) -> None:
self.wrap = cls
def __call__(self, *args, **kwargs): ...
def enhance(cls: Type[_T]) -> Type[_T]:
return Wrapper(cls) # type: ignore
class X:
...
EnhanceX = enhance(X)
reveal_type(EnhanceX)
reveal_type(EnhanceX.enhanced)
```
The user using the class doesn't really need to know that it has been "enhanced", as it should work as it was before.
My initial idea was to extend `Type` from typings, but that's not possible. What would you suggest to do here?
Should I type all the methods on `Wrapper` to basically behave as if they were from `self.wrap`? not sure if that's actually possibile
There's also a possibility where I'm doing something silly with what I'm trying to do, but it should make sense for my use case 😊