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.
Original issue opened by @erickvermot at https://github.com/kytos/python-openflow/issues/415.
Many GenericType and GenericStruct derivatives reimplement
pack(value)
andget_size(value)
, and each one rewrites the code that deals with thevalue
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 https://github.com/kytos/python-openflow/pull/392/commits/a4c1f0535d9e1a796c85785e525278a0e4490943), but I was told to close the PR and open a separate issue for that.
+ If this is implemented, then the issue (https://github.com/kytos/python-openflow/issues/196) becomes trivial.