Skip to content
This repository was archived by the owner on Apr 22, 2024. It is now read-only.
This repository was archived by the owner on Apr 22, 2024. It is now read-only.

make GenericStruct and GenericType derivatives reuse pack and get_size code #415

@erickvermot

Description

@erickvermot

Many GenericType and GenericStruct derivatives reimplement pack(value) and get_size(value), and each one rewrites the code that deals with the value parameter, as well as the docstring.

making GenericType and GenericStruct offer a pack(self, value) that deal with the parameter and offers the docstring, and internally calls the instance's _pack(self) method makes it possible to the derivatives to rewrite _pack and avoid having to rewrite the code to deal with the parameter and with the docstring, reducing a lot of redundant code.

This was implemented in the match fix PR (https://github.com/kytos/python-openflow/pull/392/commits) (mostly inside the commit a4c1f05), but I was told to close the PR and open a separate issue for that.

+ If this is implemented, then the issue (#196) becomes trivial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions