Brython-3.5.0rc1 available for testing

52 views
Skip to first unread message

Pierre Quentel

unread,
Feb 27, 2018, 5:10:39 AM2/27/18
to brython
I have published a release candidate for the next Brython version. With the huge changes made to the code base since the previous version, it is likely that regressions have been introduced, this is why for this time I prefer to start with a release candidate.

These changes were necessary to support the popular attrs module (as requested by Glyph in issue #766) and to fix a major issue in name resolution, reported by David Kosbie (issue #780).

As usual, bugs should be reported on the issue tracker.

Many thanks to all contributors, and a special thank you to André Roberge for his work on the turtle module.

- Pierre

Changes in version 3.5.0rc1

Implementation
==============
- complete rewriting of class implementation, for user-defined and builtin
  classes.  The class builder makes a more compliant use of metaclasses.
  Instance creation uses metaclass.__call__. Change the result of
  type.__getattribute__ and object.__getattribute__ for methods. Change
  object.__new__ and object.__init__. Fix implementation of __init_subclass__.
- rewriting of name resolution : replace global attribute
  __BRYTHON__.bound[scope.id] by attribute of scope node object scope.binding.
  Use scope object as argument of py2js instead of scope id. Correctly set
  parent scope in exec / eval
- implement calls with an internal function $B.$call instead of
  getattr(obj, "__call__")

- start applying code formatting rules adapted from PEP8 (needs documenting)

- use Array.forEach wherever possible.
- use ES6 syntax call_function(x, ...y) when appropriate
- change implementation of f-string to use format(expression, spec) instead of
  eval().
- set mimetype to text/plain for built-in function open(), to avoid XML
  parsing errors in the browser console
- add line numbers in generators to improve error reporting
- Javascript "undefined" is converted to an internal object that evaluates
  to False
- add attribute __module__ to methods of internal classes
- add attribute __module__ to class objects before running the class object
  builder

Bug fixes
=========
- bugs with attributes "left", "top", "width" and "height" of DOMNode
  instances
- bug in event unbinding
- bug in descriptors implementation. Simplify equality testing.
- if an event attribute is a function, convert Python arguments to Javascript
  values
- bug in DOMNode.clone() : event bindings were not copied
- fix jsobj2pyobj: Javascript null, undefined both correspond to None (by
  Jonathan Verner)
- fix relative imports (by memetum and Anpylar)
- let DOMNode instances find attributes present in forbidden (id.)
- change the algorithm to detect the class to use in super.__getattribute__
  when a second argument is provided.
- bug with parent scope of exec when globals and locals are provided

- #739 : minor turtle issues (by André Roberge)
- #742 : SyntaxError when yield from is used
- #743 : syntax error when defaults are combined with type annotations
- #744 : check whether attr is a string in setattr on jsobjects (Jonathan)
- #748 : exec() and eval() access globals
- #749 : fix equality comparison for types (Jonathan)
- #751 : raise TypeError when lex-comparing list with unorderable items
  (Jonathan)
- #755 : string format problem with classes
- #758 : inherited elements not working correctly
- #760 : str evaluation shouldn't give precedence to __repr__ instead of
  __str__ on ancestor
- #761 : instead of __str__ an object's __repr__ is invoked when passed
  into a formatting string (when no conversion flag is specified) (by
  Jurjan-Paul Medema)
- #763 : trailing commas don't raise syntax error
- #775 : unexpected token error when parsing multiline literal (that calls
  format method)
- #776 : SyntaxError with comment inside a comprehension
- #777 : import six fails
- #778 : os.listdir() can't work
- #781 : calling a dictionary should raise TypeError
- #789 : functools.total_ordering fails

Brython site
============
- move all datetime tests to test_datetime.py

Demos
=====
- rewriting of the turtle module demo, with an implementation of random
  landscape drawing (by André Roberge)

Reply all
Reply to author
Forward
0 new messages