Brython 3.9 on Scrimba

29 views
Skip to first unread message

Ray Luo

unread,
May 22, 2021, 2:05:13 PM5/22/21
to brython
(Forking a separate conversation about running Brython 3.9 on Scrimba)

> so what are the Python 3.9 features that you can't step down to 3.7? O maybe you don't want to maintain two separate distribution?

In my case, I am not even using any Python3.9-only feature. It just happens that my code base contains a line using ternary operator inside slicing, inside a list comprehension. It works in CPython, but Brython 3.8 complains a SyntaxError. Brython 3.9 apparently already fix it. I could - and might - change my code to make it work with Brython 3.8, however the more valuable problem to be solved, is why Brython 3.9 ITSELF doesn't work in Scrimba.

To repro, I start with Olof's existing scrimba https://scrimba.com/learn/python/variables-cZn93eHD
and only replace its Brython 3.7.0 line with this:

   

Next run would give me this error:

   
Javascript error, TypeError: this.addEntry is not a function

I'm not a javascript expert to tell whether that issue should be solved from Scrimba's side, or be solved from Brython.

Regards,
Ray Luo

Ray Luo

unread,
May 23, 2021, 2:52:27 PM5/23/21
to brython
Never mind. While I am releasing a charts.css.py 0.3.0 to support Brython 3.7.5 and Brython 3.8, it seems Scrimba is also doing something from their end - otherwise it would be hard to explain this - now Brython 3.9 can also be loaded and used in Scrimba.

So, this is charts.css.py running on Brython 3.9, on Scrimba. https://scrimba.com/scrim/cqW4kmuG

Perhaps other Brython 3.9-only packages, such as brycharts, would also work on Scrimba now.

Regards,
Ray Luo
Reply all
Reply to author
Forward
0 new messages