Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ajoaoff opened this issue Jun 28, 2021 · 0 comments

Comments

@ajoaoff
Copy link

ajoaoff commented Jun 28, 2021

Original issue opened by @erickvermot at kytos#415.

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 kytos@a4c1f05), but I was told to close the PR and open a separate issue for that.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant