You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When representing DLite properties with Python dataclasses or pydantic models, the @ref attribute create some trouble since it is not a valid Python identifier. Although pydantic v2 support aliases, it is an unnecessary complication and it is not supported in dataclasses, pydantic v1 and other similar framework.
The simplest solution is simply renaming the attribute from @ref to ref.
Are the any good reasons not to do so?
For backward compatibility, we could keep support for @ref in the json parser and instance_from_dict() for a while together with a deprecation warning.
The text was updated successfully, but these errors were encountered:
When representing DLite properties with Python dataclasses or pydantic models, the
@ref
attribute create some trouble since it is not a valid Python identifier. Although pydantic v2 support aliases, it is an unnecessary complication and it is not supported in dataclasses, pydantic v1 and other similar framework.The simplest solution is simply renaming the attribute from
@ref
toref
.Are the any good reasons not to do so?
For backward compatibility, we could keep support for
@ref
in the json parser andinstance_from_dict()
for a while together with a deprecation warning.The text was updated successfully, but these errors were encountered: