Skip to content

Cleanup: Get rid of _REDIRECT attribute? #157

@damskii9992

Description

@damskii9992

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

No one assigned

    Labels

    FOR DISCUSSIONTo be discussed during the group's code retreat[area] SerializationAnything related to serialization[priority] lowLow importance[scope] maintenanceCode/tooling cleanup, no feature or bugfix (major.minor.PATCH)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions