
April 5, 2022
4:48 p.m.
Yes, although to make Pyright happy I had to add a return type annotation on your implementation: def my_dataclass(cls=None, **options) -> Callable[[_ClsT], _ClsT]: ... Btw, you could also place the @dataclass_transform decorator on either overload. If you were exposing my_dataclass() in a .pyi, you would need to put dataclass_transform on an overload. -Erik