HaxeFoundation / HaxeFoundation/haxe

[python] Cannot pass keyword arguments to python.lib.Json.dumps

Open
#10,769 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haxe
Stars
6.9k
Forks
715
Avg merge
2d 2h
Merged PRs (30d)
11

Description

**Environment**
macOS 12.4
haxe 4.3.0-rc.a49b191

The following code throws the exception `TypeError: __init__() got an unexpected keyword argument '_hx_disable_getattr'`.

```
var json = python.Lib.anonAsDict({});
python.lib.Json.dumps(json, {separators: python.Tuple.Tuple2.make(",", ":")});
```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Haxe-to-Python example using python.lib.Json.dumps with the separators option. Then trace the python.lib.Json.dumps binding or entry point involved in keyword arguments. Done means the supplied snippet runs without the unexpected _hx_disable_getattr exception and preserves the requested separators.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.