PythonMonkey icon indicating copy to clipboard operation
PythonMonkey copied to clipboard

Python Feature Request regarding Dict subclasses

Open wesgarland opened this issue 11 months ago • 4 comments

Issue type

Bug

How did you install PythonMonkey?

None

OS platform and distribution

No response

Python version (python --version)

No response

PythonMonkey version (pip show pythonmonkey)

No response

Bug Description

This was an explicit design goal and I just found out that it doesn't work anymore.

If we can't create Dicts from JS, we can't use Python libraries that use Dicts.

Ironically, one such library is PythonMonkey, which uses Dicts to pass evaluation options to spidermonkey. And because JSObjectProxy is not a py_dict, PyDict_GetItemString doesn't find the filename, which is why the stack traces for the modules no longer include their filenames.

There must be a solution to this problem.

Standalone code to reproduce the issue

No response

Relevant log output or backtrace

No response

Additional info if applicable

No response

What branch of PythonMonkey were you developing on? (If applicable)

No response

wesgarland avatar Mar 01 '24 16:03 wesgarland

This is incorrect: "Unfortunately, we can no longer create dicts from JS, so option processing does not work" We clearly can. We are just missing compatibility with PyDict_GetItemString as described by Caleb We made some decisions for Full compatibility with Dicts that are not under question now that a given feature does not work for well-known reasons

philippedistributive avatar Mar 01 '24 17:03 philippedistributive

We will post a feature request to the relevant Python forum for this one

philippedistributive avatar Mar 04 '24 22:03 philippedistributive

let's keep it open until post has been done and as a follow-up on the post

philippedistributive avatar Mar 13 '24 21:03 philippedistributive

@philippedistributive Wes says to, if you like, make a separate ticket for posting a feature request to the python team, but this ticket should not be blocking v1.0.0

zollqir avatar Apr 10 '24 15:04 zollqir