Describe the solution you'd like
Add a new Alias class and use it as an annotation:
@dataclass
class Foo:
a: Annotated[str, Alias("alias_a")]
b: Annotated[str, Alias("alias_b")]
Describe alternatives you've considered
An alternative can be a la Meta class with an alias attribute. Nothing prevents us from adding such a class in the future and duplicating the functionality in it.
Is your feature request related to a problem? Please describe. The current way to assign an alias to a field is to use field metadata:
This can be written in alternative shorter way.
Describe the solution you'd like Add a new
Alias
class and use it as an annotation:Describe alternatives you've considered An alternative can be a la
Meta
class with analias
attribute. Nothing prevents us from adding such a class in the future and duplicating the functionality in it.