-
Notifications
You must be signed in to change notification settings - Fork 216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dictionary unpacking causes a transpiling error #837
Comments
There must be an edge case somewhere in the compiler. With a slightly simpler example, this works: def test(args):
print(list(args.keys()))
test(dict(**{'class': 'my-class'})) But this does not: def test(args):
print(list(args.keys()))
test({**{'class': 'my-class'}}) Though both versions work in CPython. |
Those last two examples are actually significantly different at the technical/language level, and the latter is actually a lot newer in CPython.
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 |
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: