Files
odoo_source/addons/web/static/lib/py.js/TODO.rst
T
Arthur Maniet f0cefa7232 [ADD] py.js: len() and truthiness on lists, tuples and dicts
* use new support to colorize reconciled bank statement lines
* fixes tokenization of ``is not`` to not blow up on ``not foo``
* improves calling code to get truthiness of evaluated expression
  instead of truthiness of javascript-equivalent objects: an empty list
  is falsy in Python but truthy in javascript, since the evaluated
  expression is in Python one would expect Python truthiness rules
  without having to manually convert to boolean

closes #5070
2015-02-05 13:08:15 +01:00

47 lines
1.1 KiB
ReStructuredText

* Parser
since parsing expressions, try with a pratt parser
http://journal.stuffwithstuff.com/2011/03/19/pratt-parsers-expression-parsing-made-easy/
http://effbot.org/zone/simple-top-down-parsing.htm
Evaluator
---------
* Builtins should be built-in, there should be no need to add e.g. ``py.bool`` to the evaluation context (?)
* Stop busyworking trivial binary operator
* Make it *trivial* to build Python type-wrappers
* Implement Python's `data model protocols
<http://docs.python.org/reference/datamodel.html#basic-customization>`_
for *all* supported operations, optimizations can come later
* Automatically type-wrap everything (for now anyway)
Base type requirements:
***********************
* int
* float
* --str-- unicode
* bool
* dict
* tuple
* list
* ?module
* ?object
* datetime.time
* datetime.timedelta
* NotImplementedType
Base methods requirement
************************
* ``__getattr__``
* ``dict.get``
In datamodel, not implemented in any type, untested
***************************************************
* a[b]
* a + b, a - b, a * b, ...
* +a, ~a