PythonMonkey icon indicating copy to clipboard operation
PythonMonkey copied to clipboard

JSExternalStrings we create from PyUnicodeObjects that pass back to python should become the same PyUnicodeObject

Open zollqir opened this issue 11 months ago • 0 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

While the JSStringProxy does correctly use the underlying char buffer, a JSExternalString proxying a python string should just become that exact string object when it passes back to python, rather than a proxy of a proxy.

Standalone code to reproduce the issue

import pythonmonkey as pm
a = "this is a string"
b = pm.eval("(str) => str")(a)
assert a is b

Relevant log output or backtrace

No response

Additional info if applicable

No response

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

wes/DCP-4054/make-dcp-client-grok-pythonmonkey

zollqir avatar Mar 15 '24 17:03 zollqir