You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Those last two examples are actually significantly different at the technical/language level, and the latter is actually a lot newer in CPython.
dict(**a_dictionary) is a splatting a dictionary into arguments of a function call. In Python since 2.2 (over 20 years ago).
{**a_dictionary} is splatting a dictionary into a dictionary literal "display". Added in 3.5 by PEP-448.
If I had to guess, Transcrypt has different code paths for "translating the stuff inside a function call" and "translating the stuff inside a dictionary display", and the former is expecting the possibility of a ** while the latter isn't.
Example:
Transcrypt output:
The dictionary unpack is obviously redundant in this case but is useful in more complex cases.
The text was updated successfully, but these errors were encountered: