marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
7.78k stars 273 forks source link

tuple dict keys display as strings #2667

Open anjiro opened 4 weeks ago

anjiro commented 4 weeks ago

Describe the bug

Cell output for a dict with tuples for keys renders the tuple as strings:

Input: {(1,2,3): 4}

Output:

{ 1 Items
  "(1, 2, 3)": 4
}

Environment

{ "marimo": "0.9.10", "OS": "Darwin", "OS Version": "23.6.0", "Processor": "arm", "Python Version": "3.11.2", "Binaries": { "Browser": "129.0.6668.101", "Node": "v22.9.0" }, "Dependencies": { "click": "8.1.3", "importlib-resources": "missing", "jedi": "0.18.2", "markdown": "3.5.2", "pygments": "2.14.0", "pymdown-extensions": "10.7", "ruff": "0.0.292", "starlette": "0.36.1", "tomlkit": "0.12.3", "typing-extensions": "4.9.0", "uvicorn": "0.27.0.post1", "websockets": "12.0" }, "Optional Dependencies": { "pandas": "2.0.2", "polars": "0.19.12" } }

Code to reproduce

No response

mscolnick commented 4 weeks ago

What is the expected output? This looks pretty correct to me?

akshayka commented 3 weeks ago

(1, 2, 3) shouldn't have quotes around it, since the original Python key is not a string: https://marimo.app/l/2i9nm8

Abhijeet213 commented 1 week ago

This is Just For Showing But It Is Working Fine Like Tuple You Can Check It