Dictionary unpacking causes a transpiling error

Open
#837 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, python
Domain
compilers

Research direction

Reproduce the failure with the test.py example using the reported Transcrypt command, then trace the compiler path handling the dictionary expression at line 6. The work is done when dictionary unpacking transpiles successfully and the resulting JavaScript preserves the expected attributes.

Written by the indexing model from the issue text.

Description

IS: bug?

Example:

#__pragma__('skip')
def el(name, attrs, *children):
    pass
#__pragma__('noskip')
def App():
    return el("div", {
        **{'class': 'my-class'}
    })

Transcrypt output:

$ python3 -m transcrypt test.py

Transcrypt (TM) Python to JavaScript Small Sane Subset Transpiler Version 3.9.0
Copyright (C) Geatec Engineering. License: Apache 2.0


Saving target code in: /home/tkcook/git/test/__target__/org.transcrypt.__runtime__.js
Saving minified target code in: /home/tkcook/git/test/__target__/org.transcrypt.__runtime__.js

Error while compiling (offending file last):
	File 'test', line 6, namely:
	
	Error while compiling (offending file last):
	File 'test', line 6, namely:
	

Aborted

The dictionary unpack is obviously redundant in this case but is useful in more complex cases.

Dominant language
Python
Stars
2.9k
Forks
218
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TranscryptOrg/Transcrypt

All issues in TranscryptOrg/Transcrypt

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.