You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! Love this project! I have a Python class inheriting from a list with a couple extra methods and am passing that to JavaScript (see the example below). It seems that my added methods don't exist in JavaScript. If the class inherits from set or tuple it works, but then the value is not ordered anymore. I might be doing something wrong, but any help with this would be hugely appreciated!
Standalone code to reproduce the issue
import pythonmonkey as pm
class Collection(list):
def item(self):
print("Do something")
pm.eval("(function(pyFunc) { globalThis.document = pyFunc; })")(Collection((1,2,3)))
pm.eval("console.log(document.item())")
Relevant log output or backtrace
Traceback (most recent call last):
File "/home/andrew/Downloads/TkinterWebBrowser.py", line 10, in<module>pm.eval("console.log(document.item())")pythonmonkey.SpiderMonkeyError: Error in file evaluate, on line 1, column 22:TypeError: document.item is not a functionStack Trace: @evaluate:1:22
Additional info if applicable
What branch of PythonMonkey were you developing on? (If applicable)
No response
The text was updated successfully, but these errors were encountered:
Issue type
Bug
How did you install PythonMonkey?
Installed from pip
OS platform and distribution
Ubuntu
Python version (
python --version
)3.12
PythonMonkey version (
pip show pythonmonkey
)1.1.0
Bug Description
Hello! Love this project! I have a Python class inheriting from a
list
with a couple extra methods and am passing that to JavaScript (see the example below). It seems that my added methods don't exist in JavaScript. If the class inherits fromset
ortuple
it works, but then the value is not ordered anymore. I might be doing something wrong, but any help with this would be hugely appreciated!Standalone code to reproduce the issue
Relevant log output or backtrace
Additional info if applicable
What branch of PythonMonkey were you developing on? (If applicable)
No response
The text was updated successfully, but these errors were encountered: