On 12/19/18 2:19 PM, Eric Blake wrote:
> On 12/19/18 12:57 PM, John Snow wrote:
>>
>>
>> On 12/19/18 1:52 PM, Eric Blake wrote:
>>> On 12/18/18 7:52 PM, John Snow wrote:
Python before 3.6 does not sort kwargs by default.
If we want to print out pretty-printed QMP objects while
pre
On 12/19/18 12:57 PM, John Snow wrote:
On 12/19/18 1:52 PM, Eric Blake wrote:
On 12/18/18 7:52 PM, John Snow wrote:
Python before 3.6 does not sort kwargs by default.
If we want to print out pretty-printed QMP objects while
preserving the "exec" > "arguments" ordering, we need a custom sort.
On 12/19/18 1:52 PM, Eric Blake wrote:
> On 12/18/18 7:52 PM, John Snow wrote:
>> Python before 3.6 does not sort kwargs by default.
>> If we want to print out pretty-printed QMP objects while
>> preserving the "exec" > "arguments" ordering, we need a custom sort.
>
> Naive question - why do we
On 12/18/18 7:52 PM, John Snow wrote:
Python before 3.6 does not sort kwargs by default.
If we want to print out pretty-printed QMP objects while
preserving the "exec" > "arguments" ordering, we need a custom sort.
Naive question - why do we need the sorting? Is it so that the output is
determ
On 12/19/18 11:55 AM, John Snow wrote:
+def ordered_kwargs(kwargs):
+# kwargs prior to 3.6 are not ordered, so:
+od = OrderedDict()
+for k in sorted(kwargs.keys()):
you can use for k, v in sorted(kwargs.items()):
and use then v instead of kwargs[k]
I don't need to sort the tuple
On 12/19/18 5:20 AM, Vladimir Sementsov-Ogievskiy wrote:
> 19.12.2018 4:52, John Snow wrote:
>> Python before 3.6 does not sort kwargs by default.
>> If we want to print out pretty-printed QMP objects while
>> preserving the "exec" > "arguments" ordering, we need a custom sort.
>>
>> We can acco
19.12.2018 4:52, John Snow wrote:
> Python before 3.6 does not sort kwargs by default.
> If we want to print out pretty-printed QMP objects while
> preserving the "exec" > "arguments" ordering, we need a custom sort.
>
> We can accomplish this by sorting **kwargs into an OrderedDict,
> which does
Python before 3.6 does not sort kwargs by default.
If we want to print out pretty-printed QMP objects while
preserving the "exec" > "arguments" ordering, we need a custom sort.
We can accomplish this by sorting **kwargs into an OrderedDict,
which does preserve addition order.
---
tests/qemu-iotes