-
Notifications
You must be signed in to change notification settings - Fork 514
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling a JS function with a dict
in Brython 3.13 doesn't work.
#2542
Comments
dict
in Brython 3.13 doesn't work.
Note: As a workaround, I can do that for the moment: from javascript import pyobj2jsobj
from js_modules.tippy_js import tippy as tippy_ori
def tippy(target, data):
return tippy_ori(target, pyobj2jsobj(data)) But:
|
Bonjour Jérôme, There hasn't been a change (at least, volontary...) to modify this feature in version 3.13, arguments passed to a JS function as a dictionary should still be translated to Javascript objects. I tried to reproduce the bug, but in this example the data passed as a dict is correctly handled by tippy <!doctype html>
<html>
<head>
<meta charset="utf-8">
<script src="https://raw.githack.com/brython-dev/brython/master/www/src/brython.js"
crossorigin="anonymous">
</script>
<script src="https://raw.githack.com/brython-dev/brython/master/www/src/brython_stdlib.js"
crossorigin="anonymous">
</script>
</head>
<body>
<button id="myButton">My button</button>
<script type="text/python" debug="2">
from browser import window, load
# use "browser.load" as in the bug report. Files stored in subdirectory "tippy"
load('tippy/popper.min.js')
load('tippy/tippy-bundle.umd.js')
window.tippy('#myButton', {'content': 'My Brython tooltip !'})
</script>
</body>
</html> It is the same with the development version and with the latest stable release 3.13.0. I tried to load the whole libervia project but couldn't make it work to reproduce the issue. |
Hello,
I'm using tippy.js with Brython in my project. Here is how I do a typical call:
https://repos.goffi.org/libervia-web/file/5d9889f14012/libervia/web/pages/chat/_browser/__init__.py#l542
So I'm using a python
dict
for calling the JS function. This was working well until now, but with Brython3.13
, it's not working anymore, and the result is as if I were using and emptydict
, thedict
to JS object conversion doesn't seem to work as expected.For the context, here is how I import
tippy
:I can make is work if I do that:
So it seems that something has changed in Brython Python dict => JS object conversion which breaks the use of Python dict directly in JS function.
Thanks!
The text was updated successfully, but these errors were encountered: