
Yes, although to make Pyright happy I had to add a return type annotation on your implementation:
If I understand, this is a Pyright bug right ? As implementations should not have typing annotation I believe.
If you were exposing my_dataclass() in a .pyi, you would need to put dataclass_transform on an overload.
Is it not a confusing ? I would intuitively expect the that only the `@overload` on which `@dataclass_transform` is applied transform the class. ``` @overload def create_model(cls: A) -> A: @overload @dataclass_transform def create_model(cls: B) -> B: ``` So in this case, I would expect `create_model` to transform B to dataclass, but not A. (this is just a dummy unrealistic example just to show my point) Why not have the overload explicitly be applied on each overload ? I feel this would be least ambiguous case. ``` @overload @dataclass_transform def create_model(cls: A) -> A: @overload @dataclass_transform def create_model(cls: B) -> B: @overload def create_model(cls: C) -> C: ``` Here A and B are transformed to dataclasses, but not C. Would there be a drawback to explicitly marking each overload as @dataclass_transform ?