Furthermore, this PR improves typing of some Client methods to enhance developer experience:
Previous behaviour
Methods such as get or get_all were typed as returning RootEntity objects. Therefore, some attributes and autocomplete features were missed:
New behaviour
Now, these methods are typed using a generic TypeVar, so the returned object will be of the correct type if a class is used as model_type parameter. This will improve user experience adding autocomplete, more accurate typing, etc:
Roll back to
typing.List
usage instead of standard lib generics. This way, Python version requirement is 3.6+ instead of 3.9+.Also,
yaml.load(input)
method from pyyaml is deprecated and produces an error in last version. So this PR changes that foryaml.full_load(input)
. More info here: https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-DeprecationFurthermore, this PR improves typing of some
Client
methods to enhance developer experience:Previous behaviour
Methods such as
get
orget_all
were typed as returningRootEntity
objects. Therefore, some attributes and autocomplete features were missed:New behaviour
Now, these methods are typed using a generic
TypeVar
, so the returned object will be of the correct type if a class is used asmodel_type
parameter. This will improve user experience adding autocomplete, more accurate typing, etc: