flexx
flexx copied to clipboard
Pyscript double quote transpiling
I encountered an issue where a default property was set like this:
@event.prop
def default_label(self, value=""):
return str(value)
And the value shown in the client side was "Null" while I was expecting an empty string. Setting the quote to single quotes style solved the issue:
@event.prop
def default_label(self, value=''):
return str(value)
A possible fix would be to force all quotes, double and single to transpile to single quotes.
This is slightly frightening.
I cannot reproduce it though. What do you mean by "the value shown in the client side"?
from flexx import app, ui, event
class Example(ui.Widget):
class JS:
@event.prop
def default_label1(self, value=''):
return str(value)
@event.prop
def default_label2(self, value=""):
return str(value)
m = app.launch(Example, 'firefox')
Sorry, this one was a mistake in my code, I tested it extensively and can confirm that it's the same. I will close this one.