yasoo
Advanced tools
+1
-1
| Metadata-Version: 2.1 | ||
| Name: yasoo | ||
| Version: 0.10.0 | ||
| Version: 0.11.0 | ||
| Summary: Yet another serializer of objects | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/drorvinkler/yasoo |
+1
-1
@@ -9,3 +9,3 @@ import setuptools | ||
| name="yasoo", | ||
| version="0.10.0", | ||
| version="0.11.0", | ||
| author="Dror A. Vinkler", | ||
@@ -12,0 +12,0 @@ description="Yet another serializer of objects", |
| Metadata-Version: 2.1 | ||
| Name: yasoo | ||
| Version: 0.10.0 | ||
| Version: 0.11.0 | ||
| Summary: Yet another serializer of objects | ||
@@ -5,0 +5,0 @@ Home-page: https://github.com/drorvinkler/yasoo |
@@ -104,2 +104,3 @@ import json | ||
| allow_extra_fields: bool = False, | ||
| ignore_custom_deserializer: bool = False, | ||
| globals: Optional[Dict[str, Any]] = None, | ||
@@ -115,2 +116,3 @@ ) -> T: | ||
| allow_extra_fields: bool = False, | ||
| ignore_custom_deserializer: bool = False, | ||
| globals: Optional[Dict[str, Any]] = None, | ||
@@ -128,2 +130,5 @@ ) -> T: | ||
| definition, or just ignore them. | ||
| :param ignore_custom_deserializer: Whether to ignore the custom deserializer for this obj_type and use the | ||
| default serializer instead. This only applies to the top level object, not to any inner objects | ||
| (see ``unregister`` for ignoring custom deserializer for inner objects as well). | ||
| :param globals: A dictionary from type name to type, most easily acquired using the built-in ``globals()`` | ||
@@ -138,3 +143,8 @@ function. | ||
| return self._deserialize( | ||
| data, obj_type, type_key, allow_extra_fields, globals or {} | ||
| data, | ||
| obj_type, | ||
| type_key, | ||
| allow_extra_fields, | ||
| globals or {}, | ||
| ignore_custom_deserializer, | ||
| ) | ||
@@ -149,2 +159,3 @@ | ||
| external_globals: Dict[str, Any], | ||
| ignore_custom_deserializer: bool = False, | ||
| ): | ||
@@ -167,10 +178,11 @@ all_globals = dict(globals()) | ||
| deserialization_method = self._custom_deserializers.get( | ||
| obj_type, self._custom_deserializers.get(real_type) | ||
| ) | ||
| if deserialization_method: | ||
| return deserialization_method(data) | ||
| for base_class, method in self._inheritance_deserializers.items(): | ||
| if issubclass(real_type, base_class): | ||
| return method(data, real_type) | ||
| if not ignore_custom_deserializer: | ||
| deserialization_method = self._custom_deserializers.get( | ||
| obj_type, self._custom_deserializers.get(real_type) | ||
| ) | ||
| if deserialization_method: | ||
| return deserialization_method(data) | ||
| for base_class, method in self._inheritance_deserializers.items(): | ||
| if issubclass(real_type, base_class): | ||
| return method(data, real_type) | ||
@@ -177,0 +189,0 @@ key_type = None |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
53335
1.2%978
1.24%