Transcrypt
Transcrypt copied to clipboard
dict constructor does not support keyword arguments
It does not allow dict(a=1, b=2) which I can live without, but it also does not allow dict(a, b=2) and dict(a, **b) which is unfortunate.
All of the following work:
# python
a = dict(a=1, b=2)
b = dict(a, b=2)
c = dict(a, **{"b": 2})
// js output
// import {...}
var __name__ = '__main__';
export var a = dict (__kwargtrans__ ({a: 1, b: 2}));
export var b = dict (a, __kwargtrans__ ({b: 2}));
export var c = dict (a, __kwargtrans__ (dict ({'b': 2})));
Tested in chromium console