diff options
| author | tsabi <csaba.toth@i3rendszerhaz.hu> | 2012-11-29 12:41:32 +0100 |
|---|---|---|
| committer | tsabi <csaba.toth@i3rendszerhaz.hu> | 2012-11-29 12:41:32 +0100 |
| commit | 76ca47d4fd0bd178fd7dfd2ea5b534d4e878a6f5 (patch) | |
| tree | 32339ef0c6869f21bb757f8ab6bce7faf8028c6b /addons/web/static/lib/py.js/README.rst | |
| parent | e2435d4f004a20636aef8a8ee2cc03c8cfc3e78c (diff) | |
| parent | c7772fdd82105ddf60cbec2517753bf927ce19ed (diff) | |
[MERGE] trunk
bzr revid: csaba.toth@i3rendszerhaz.hu-20121129114132-gfe3sn1p5t0mzofm
Diffstat (limited to 'addons/web/static/lib/py.js/README.rst')
| -rw-r--r-- | addons/web/static/lib/py.js/README.rst | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/addons/web/static/lib/py.js/README.rst b/addons/web/static/lib/py.js/README.rst index 046db7153d1..7601318df6d 100644 --- a/addons/web/static/lib/py.js/README.rst +++ b/addons/web/static/lib/py.js/README.rst @@ -1,14 +1,7 @@ What ==== -``py.js`` is a parser and evaluator of Python expressions, written in -pure javascript. -``py.js`` is not intended to implement a full Python interpreter -(although it could be used for such an effort later on), its -specification document is the `Python 2.7 Expressions spec -<http://docs.python.org/reference/expressions.html>`_ (along with the -lexical analysis part). Syntax ------ @@ -60,7 +53,7 @@ Builtins Same as tuple (``list`` is currently an alias for ``tuple``) ``dict`` - Implements just about nothing + Implements trivial getting and setting, nothing beyond that. Note that most methods are probably missing from all of these. @@ -69,17 +62,17 @@ Data model protocols ``py.js`` currently implements the following protocols (or sub-protocols) of the `Python 2.7 data model -<http://docs.python.org/reference/datamodel.html>`_: +<>`_: Rich comparisons - Roughly complete implementation but for two limits: ``__eq__`` and - ``__ne__`` can't return ``NotImplemented`` (well they can but it's - not going to work right), and the behavior is undefined if a - rich-comparison operation does not return a ``py.bool``. + Pretty much complete (including operator fallbacks), although the + behavior is currently undefined if an operation does not return + either a ``py.bool`` or ``NotImplemented``. - Also, a ``NotImplemented`` result does not try the reverse - operation, not sure if it's supposed to. It directly falls back to - comparing type names. + ``__hash__`` is supported (and used), but it should return **a + javascript string**. ``py.js``'s dict build on javascript objects, + reimplementing numeral hashing is worthless complexity at this + point. Boolean conversion Implementing ``__nonzero__`` should work. @@ -93,6 +86,12 @@ Descriptor protocol As with attributes, ``__delete__`` is not implemented. Callable objects + Work, although the handling of arguments isn't exactly nailed + down. For now, callables get two (javascript) arguments ``args`` + and ``kwargs``, holding (respectively) positional and keyword + arguments. + + Conflicts are *not* handled at this point. Collections Abstract Base Classes Container is the only implemented ABC protocol (ABCs themselves @@ -119,8 +118,8 @@ implementation: ``py.js`` types. When accessing instance methods, ``py.js`` automatically wraps - these in a variant of ``py.def`` automatically, to behave as - Python's (bound) methods. + these in a variant of ``py.def``, to behave as Python's (bound) + methods. Why === |
