NetLogo / NetLogo/Python-Extension
Dicts with non-string keys get serialized wrong
Nobody has claimed this yet.
- Dominant language
- Scala
- Stars
- 31
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
Copied from with more discussion at: https://github.com/qiemem/PythonExtension/issues/6
Some examples:
observershow py:runresult "{1: 2}"
observer: [["1" 2]]
observershow py:runresult "{(1,2): 3}"
Extension exception: keys must be a string
While JSON is restricted to string keys, we are not. We need to hijack JSON's dict serialization to turn them into a list of pairs instead.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how the Python extension handles the py:runresult examples and where dictionaries are passed through JSON serialization. Reproduce the {1: 2} and {(1,2): 3} cases, then verify that non-string-key dictionaries serialize as lists of pairs without the current incorrect output or exception.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, scala
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100