-
Notifications
You must be signed in to change notification settings - Fork 35
Unpack should return an object #130
Comments
@beraldoleal I don't think we will be able to reach this feature before #198 and #237. |
@diraol ok, no problem. b3 is a good target. |
Edit: Some unpack methods rely on instance attributes (e.g. enum_ref). Thus, a class method won't work for all cases. |
@cemsbr Why not use python's method directly to unpack instead of using struct, keeping '.value', etc.. that's what I proposed here: #198 (comment) |
@erickvermot, I think the pattern |
@cemsbr why not? |
There's no need to create extra private methods. We can have only the public ones and children can override them if necessary. |
@cemsbr Yes, you can, and this is the way it is done now. But this makes the derivative classes have to rewrite the docstring, and any other processing that is done prior to the actual packing action (like treating the optional arguments, or updating the length field in GenericMessages derivatives), which leads to massive amounts of redundant code, like in the current implementation. |
Refactor unpack methods to return the unpacked object instead of being an inplace method.
Probably the TODO creator meant implementing a class method so we would call
FixedTypeList.unpack(buff)
, for instance.The text was updated successfully, but these errors were encountered: