Avi Kivity wrote:
But we have two null conditions to check for, in an extendible
dictionary:
1. The feature is unknown to qemu
2. The feature is known to qemu, but disabled
So, "if 'field' in result:" tests the former, and "if
result['field']:" tests the latter.
In your example, a period of None makes no sense, so it would be
sufficient to
period = hpet_info.get('period', 0.100)
By the same token, wouldn't you probably do:
name = hpet_info.get('name', None)
Let me put it another way, I don't think adding null to the json parser
and incorporating it into this command is a good idea at this stage in
the release so if we want to do something like this, we need to defer it
to 0.13.
I agree there are some instances where null could be useful. I think we
can get away without it here though.
--
Regards,
Anthony Liguori