Brython 3.3.3 released

105 views
Skip to first unread message

Pierre Quentel

unread,
Sep 17, 2017, 12:19:37 PM9/17/17
to brython
I have released Brython-3.3.3 and updated brython.info.

It brings many changes, I wasn't sure if I shoud choose 3.4.0 or 3.3.3 but the work on application packaging and distribution is not mature enough.

The main changes are :
  • add arguments --modules and --make_dist to CPython brython module, to allow distribution of Brython applications through the standard Python process (PyPI, pip). Still work in progress.
  • implementation of f-strings introduced in CPython 3.6 (PEP 498)
  • improvements to metaclass implementation (by "DRo")
  • implement web workers with the webworker module (by Jonathan Verner)
  • simplified version of asyncio and new asyncio.fs module : implements an async open method to access local/remote files (by Jonathan Verner)
The complete changelog is below. Thanks to all contributors and for this one, special thanks to "Dro" and Jonathan !
Pierre

New features
============
- add arguments --modules and --make_dist to CPython brython module, to
  allow distribution of Brython applications through the standard
  Python process (PyPI, pip). Still work in progress.
- implementation of f-strings introduced in CPython 3.6 (PEP 498)
- improvements to metaclass implementation, support of __init__ and
  __call__ (by "DRo")
- module browser.html supports a function maketag() to create new tags.
  Cf issue #624 and PR #644 by DRo.
- add method select of DOMNode instances : elt.select(SEL) is an alias of
  elt.get(selector=SEL)
- add DOMNode.index() : returns the rank of the element in its parent children
- support half of PEP 487 (__init_subclass__)
- implement web workers with the webworker module (by Jonathan Verner)
- asyncio.fs: implements an async open method to access local/remote files (by
  Jonathan)

Implementation
==============
- improve implementation of DOMNode.clear()
- add attributes "real" and "imag" to floats
- add method __float__ to int instances
- add or fix many methods and attributes of complex numbers (mostly by
  Jonathan)

Bug fixes
=========
- bug in sudoku demo
- bug in open()
- bug for CGI scripts
- bug for DOMNode attributes
- bug with collection.deque
- bug with __slots__ and subclasses
- typos and fixes in several scripts (by cclauss)
- bug in method attributes (__func__, __self__, etc)
- bug in object() : didn't raise an exception with "object(x=0)"
- issue with some attributes (toString, toLocaleString...)

Issues
- #570 : stable url for cdn.rawgit.com
- #590 : bug in input()
- #592 : Pow Error
- #596 : float(False) and float(True) crashes
- #597 : bool() should error with too many arguments
- #598 : __slots__ mixed functionality
- #600 : __eq__ with subclassing
- #601 : .keys() .items() and ==
- #602 : dictionary changed size during iteration errors
- #603 : list aliasing correctness issue
- #604 : sequence testing should test in order and stop when found
- #605 : javascript error message for incorrect list slicing
- #606 : print sep,end issues (partial fix)
- #610 : function annotations order with default arguments
- #612 : ImportError: cannot import name 'ElementPath'
- #614 : hidden extra 'length' attribute in namedtuples
- #615 : unneeded parameters not raising an exception when creating instances
  of user-defined classes
- #619 : html tag subclassing obscures `list` functionality
- #638 : internal Javascript error when parsing invalid python code
- #641 object.__init__ raising exception if empty kwargs are passed from
  subclasses (by DRo)
- #649 : class definition errors have unhelpful tracebacks
- #652 : functions cannot have arguments named 'arguments'
- #654 : printing exceptions differs from CPython
- #658 : SyntaxError, Unbalanced bracket when comment added on line
- #659 : method `__name__` differs from cpython
- #660 : multiple calls to `traceback.format_exc` differs
- #663 : single statement multi-assignment assigns wrong value
- #667 : continue fails mysteriously in generator
- #669 : "is" operator differs on floats
- #674 : embedding objects in HTML Elements as attributes

Demos
=====
- add XML parsing demo
- add examples for "insert after" and "insert before" in demo.html.

Standard distribution
=====================
- simplify implementation of asyncio and adapt it to the browser context
  (by Jonathan Verner)
- simplify some modules to limit imports
- remove xml.dom package, unusable because of lack of pyexpat module (cf.
  issue #613)
- move module turtle from site-packages to Lib + fix a bug
- add an experimental template module, inspired by patrom
- add browser.webworker to support Web Workers (by Jonathan Verner)
- add sys.float_infos
- in browser.makrdown, _ inside a word is left unchanged ("github-flavoured")s

Documentation
=============
- remove pydom documentation
- document changes to DOMNode instances, browser.html

frederic kavita

unread,
Sep 20, 2017, 6:43:56 AM9/20/17
to brython
Salut pierre tu l'a mit a jour sur pip install brython la dernière version de brython ?

Pierre Quentel

unread,
Sep 20, 2017, 11:50:18 AM9/20/17
to brython


Le mercredi 20 septembre 2017 12:43:56 UTC+2, frederic kavita a écrit :
Salut pierre tu l'a mit a jour sur pip install brython la dernière version de brython ?
 
Salut  ! Je viens de le faire, c'est la version modifiée avec la nouvelle façon de générer brython_modules.js (cf doc).
J'ai aussi ajouté une option --server pour lancer un serveur HTTP et --port pour spécifier le port ; mais ça reste à documenter. De façon générale il reste encore du boulot sur ce package...

frederic kavita

unread,
Sep 20, 2017, 7:25:00 PM9/20/17
to brython
ok merci beaucoup !!! 

frederic kavita

unread,
Sep 22, 2017, 11:41:43 AM9/22/17
to brython
il me sort une erreur


root@itechnologie-Aspire-E5-531:/home/i-technologie# pip3 install brython
Collecting brython
  Using cached brython-3.3.3.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-zpyicx6l/brython/setup.py", line 14, in <module>
        os.path.join("data", "{}.js".format(fname)))
      File "/usr/lib/python3.5/shutil.py", line 120, in copyfile
        with open(src, 'rb') as fsrc:
    FileNotFoundError: [Errno 2] No such file or directory: '/tmp/pip-build-zpyicx6l/www/src/brython.js'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-zpyicx6l/brython/

frederic kavita

unread,
Sep 22, 2017, 2:37:35 PM9/22/17
to brython
c'est reglé

Pierre Quentel

unread,
Sep 22, 2017, 3:48:58 PM9/22/17
to brython


Le vendredi 22 septembre 2017 20:37:35 UTC+2, frederic kavita a écrit :
c'est reglé

Oui, parce que j'ai supprimé la 3.3.3 sur PyPI... Il va falloir que je passe à la 3.3.4 rapidement. Merci de l'avoir signalé !

frederic kavita

unread,
Sep 23, 2017, 7:00:59 AM9/23/17
to brython
Pierre si je veux faire des commits brython  je peux soumettre sur github ?

Mais ça sera que du codage coté python 
Reply all
Reply to author
Forward
0 new messages