Brython-3.0.2 发布,Python 替代 JavaScript
jopen 10年前
Brython 设计用于替换网页上的 JavaScript 脚本语言,它使用 Python 来编写脚本,并直接在网页上执行。
Brython-3.0.2 发布,此版本主要是修改字典的实现,性能方面有大幅度的提升;同时还修复了一些 Brython 网站浏览器版本的 bug。
此版本现已提供下载,以下详细更新内容:Changes in Brython version 3.0.2
================================
New features
============
Implementation
==============
- destroy internal variables after comprehensions and generator expressions
are executed
- add URLParameter function to browser module (by Billy Earney)
- new, much faster dict implementation (by James Hutchison and Billy Earney)
- dramatic performance improvement of str.format when format has 2 or more {}
(by Mike "mrwwalmsley")
- add UUID function, replace some indent code with customized repeat functions
(by Billy Earney)
Bug fixes
=========
- sys.stderr and sys.stdout can be reset (previously, only sys.stderr.write
and sys.stdout.write could be)
- raise errors for assignment to None, True, False, debug
- fix bug in dir()
- string representation of functions and class methods are more compliant with
that of CPython
- restore "throw" as a forbidden attribute (this broke Brython for some
browsers on smartphones)
Issues
- issue #68 : possible silent overflow of larger ints (the bug is not fixed,
but the results are more sensible)
- issue #82 : Ellipsis literal (...) missing
- issue #83 : sys.version_info bug (by Billy Earney)
- issue #84 : displaying the false(y) values in Brython console
Brython site
============
- improved slideshow
- update JSON test (the expected result was incorrect for one of the tests)
- remove invalid "width" ace.js parameter (by Billy Earney)
Demos
=====
Standard distribution
=====================
- in browser.html and browser.svg, underscores in keywords are translated into
hyphens : svg.rect(font_size=22) is correctly handled, with SVG attribute
font-style set
- changes to random.py to make it load much faster. Makes the replacement
module __random useless
- changes to re.py to make it load faster
Documentation
=============
- move bind/unbind demo from gallery to cookbook
- a few spelling corrections (by Dawson Botford)
- fix an error in README.md (suggested by Roger Erens)
- document improvement in browser.html and browser.svg
- more document files use the built-in highlighting syntax module
- change doc of the local storage modules (fr and en versions)