New this week
Pierre has been busy... He implemented the ternary operator, that is, a way to assign one of two values, based on a condition, for example:
x = 7 if a > 2 else 17List comprehensions are also in! This was a heavily requested feature that was missing from Brython, for example:
y = [ x ** 2 for x in range(10)]I did find a bug in some variations, and am looking into the code to fix this.
Another addition this week is that your python code indentation is now relative to the first line of your script, instead of having to start at the first position. That means you can now format your html code and have your Python properly aligned:
def myfunc():return Truelog(myfunc())