-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
FOR DISCUSSIONTo be discussed during the group's code retreatTo be discussed during the group's code retreat[area] SerializationAnything related to serializationAnything related to serialization[priority] lowLow importanceLow importance[scope] maintenanceCode/tooling cleanup, no feature or bugfix (major.minor.PATCH)Code/tooling cleanup, no feature or bugfix (major.minor.PATCH)
Description
The _REDIRECT attribute is an attribute currently only used by descriptor_base and Parameter. The attribute is a dictionary where each key is an attribute name and the value of None indicates that the attribute should be skipped during serialization.
The logic for this is in the serializer_base class.
Currently, the only skipped attributes are the "parent" attribute" of descriptor_base (do we even need this?). And the callback attribute of the Parameter class (why is this even an attribute?).
We also have another methodology to skip attributes, namely the "skip" keyword in the to_dict method.
If we use the "skip" keyword we can get rid of the _REDIRECT attribute by simply overwriting the to_dict method:
def to_dict(self, skip):
super().to_dict(skip=['parent'].append(skip))Metadata
Metadata
Assignees
Labels
FOR DISCUSSIONTo be discussed during the group's code retreatTo be discussed during the group's code retreat[area] SerializationAnything related to serializationAnything related to serialization[priority] lowLow importanceLow importance[scope] maintenanceCode/tooling cleanup, no feature or bugfix (major.minor.PATCH)Code/tooling cleanup, no feature or bugfix (major.minor.PATCH)