-
Notifications
You must be signed in to change notification settings - Fork 517
JS Number converted to <Javascript undefined>
instead of <class 'float'>
for async functions
#2321
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
Comments
Can you try again using this PR : #2300 ? |
I am not sure what you mean. Based on that PR would you like me to try and add a custom JS -> Py conversion method to overwrite the current circumstance which is leading to If that is the case, does that meant that by default the converting to |
No, I just want to see if the code in this PR works in your case in order to investigate the cause of your issue. |
Cool. Let me know if this is what you're after: https://stackblitz.com/edit/js-8tw6yo?file=index.html Same stackblitz as above but loading brython scripts from the #2300 |
Hum, it seems to work with my version ? Gotta do the changes (maybe at the end of the week?) requested by @PierreQuentel so that the PR is merged. |
This is the console output I see for the stackblitz using the forked brython version:
The logged type using of the converted float is |
Maybe an issue related to Wednesday I'll try to take a deeper look on it (except if Pierre solves it first). |
Thanks to both of you :-) The issue should be solved, but if not please comment again, I will reopen it. |
Hello,
stackblitz where bug is recreated: https://stackblitz.com/edit/js-mndfxt?file=index.js
I am attempting to return a float value from an async javascript function defined through the window and executed with the aio module. Inside the coroutine the python calls the function assigned to the window. The function returns a float which when read in python is of type
<Javascript undefined>
rather than of type<class 'float'>
.From testing currently it seems:
<class 'int'>
are converted to<class 'int'>
. It is not included in the stackblitz but I've also checked and strings and bools are converted to their respective types.<class 'float'>
<class 'float'>
not as<Javascript undefined>
<class 'float'>
.Based on the above I am assuming the conversion of number to
<Javascript undefined>
for floats is a bug and not expected behaviour.The text was updated successfully, but these errors were encountered: