Use `.items()` to walk through keys and values
This code is likely some Python 2 holdover code from before one could
use generator expressions in `dict`s. As we are Python 3 only (and 3.6+
at that), rewrite this to be a generator expression that populates the
full `dict` in one pass.
@@ -231,8 +231,7 @@ def unpack_remotedata(o, byte_keys=False, myset=None):
return typ(outs)
elif typ is dict:
if o:
- values = [unpack_remotedata(v, byte_keys, myset) for v in o.values()]
- return dict(zip(o.keys(), values))
+ return {k: unpack_remotedata(v, byte_keys, myset) for k, v in o.items()}
else:
return o
elif issubclass(typ, WrappedKey): # TODO use type is Future
