Perform boolean serialization before integer serialization.#368
Perform boolean serialization before integer serialization.#368dthiele wants to merge 1 commit intorobshakir:masterfrom
Conversation
|
The failed "black checks" from |
#369 would fix those |
|
As there is no change in the unittests, I wonder if this PR has actually any effects, or changes anything. @dthiele , could you please add a test under |
|
I stumbled across this issue, when I accidentally passed a plain |
Looking at the unit test code in https://github.com/robshakir/pyangbind/tree/master/tests/serialise and in my experience using I would suggest you raise an Issue linked to this PR. If other people upvote or comment there, it means it is a common use and this fix is needed. |
Hi,
as a bool is an instance of int in Python (cf. https://peps.python.org/pep-0285/#specification), this PR changes the native type serialization order of YangDataSerialiser.default() so that bool is serialized before int. Otherwise, bools will be serialized as 0 or 1.
Best regards,
Daniel