Brython3.5.1 released

43 views
Skip to first unread message

Pierre Quentel

unread,
Apr 17, 2018, 3:56:11 AM4/17/18
to brython
I have released version 3.5.1, published it on PyPI and npm, and updated brython.info.

It breaks previous code, but for a good reason : the syntax

@document[element_id].bind("click")

used for event binding in many examples since version 3.3.5 was not valid Python.

Because of this, the decorator version of bind() doesn't bring any improvement, it is not documented any more.

Another important change is an important rewriting of the Python to Javscript converter by Jonathan.

The complete changelog is below.

New features
============
- the "new feature" is the correction of a wrong syntax for decorators : the
  syntax for event binding introduced in version 3.3.5 was used in many
  examples as @document[element_id].bind("click"), which is not valid
  Python (cf issue #805). This syntax now raises a SyntaxError ; all the
  examples have been rewritten using the legacy syntax, without a decorator.

Implementation
==============
- major rewriting of py2js : clean up the code in many places, make functions
  and classes usable outside of the script, eg in the browser console (by
  Jonathan Verner)
- "yield from" implementation is now conform to PEP 808 (id.)
- fix CI tests (id.)

Bug fixes
=========
- bug when hashlib is used with brython_stdlib.js
- bug with name resolution in the interactive console

Issues:
- #801 : "for" cycle evaluates the iterable expression multiple times (by
  Jonathan Verner)
- #803 : crash (Page lock) with simple script
- #805 : a decorator can only be made of a dotted name, or a call of a
  dotted name (syntax @document[elt_id].bind(event) in previous versions
  was not valid Python)
- #808 : __setattr__ of super crashes

Brython site
============

Github site
===========

Demos
=====
- remove occurrences of wrong syntax @document[elt_id].bind(event)

Standard distribution
=====================

Documentation
=============
- remove occurrences of wrong syntax @document[elt_id].bind(event). Remove
  mentions of the decorator syntax for event binding


Jonathan Verner

unread,
Apr 18, 2018, 4:31:41 PM4/18/18
to brython
- major rewriting of py2js : clean up the code in many places, make functions
  and classes usable outside of the script, eg in the browser console (by
  Jonathan Verner)

Actually, it wasn't a rewrite, except for the 'yield from' handling, the changes I made were small :-)

And thanks for the release!!
Reply all
Reply to author
Forward
0 new messages