We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when using structure_attrs_fromdict cattrs doesnot honour 'alias' name for the field..
structure_attrs_fromdict
For example:
@define class Dummy: key1: str key3: str = field(alias="key2") input_dict = {"key1": "test1", "key2": "test3"} cattrs.structure_attrs_fromdict(b, Dummy)
Should work. But it gives this error
TypeError: Dummy.__init__() missing 1 required positional argument: 'key2'
Where as creating attrs class direclty works instance = Dummy(key1 = "value1", key2="value2")
instance = Dummy(key1 = "value1", key2="value2")
The text was updated successfully, but these errors were encountered:
Hello,
closing as dupe of #322. Haven't gotten around to it yet!
Sorry, something went wrong.
closed in favour of #322
No branches or pull requests
Description
when using
structure_attrs_fromdict
cattrs doesnot honour 'alias' name for the field..For example:
Should work. But it gives this error
TypeError: Dummy.__init__() missing 1 required positional argument: 'key2'
Where as creating attrs class direclty works
instance = Dummy(key1 = "value1", key2="value2")
The text was updated successfully, but these errors were encountered: