| Issue 240: | `Evaluate` keyword should take an optional list of modules to add into the namespace of the evaluated expression | |
| Back to list |
Sign in to add a comment
|
It's possible, but a bit awkward and really ugly, to use __import__ like:
| ${res} = | Evaluate | __import__('math').ceil(${res}/2) |
It would be nicer to have an optional argument that specifies what modules
(separated with comma) to import like:
| ${res} = | Evaluate | math.ceil(${res}/2) | math |
We could also automatically import often used modules like os, sys and
above math.
Implementing this would be really simple since we can pass imported modules
to eval as a namespace dictionary.
|
||||||||||||
,
Feb 25, 2009
(No comment was entered for this change.)
Owner: ---
|
|||||||||||||
,
Mar 23, 2009
Added the possibility to give a list of modules to Evaluate in r1479 (and tests in r1480). This implementation doesn't add any modules to the namespace automatically. Should we do that or not?
Summary: Evaluate keyword should take an optional list of modules to add into the namespace of the evaluated expression
Status: Started Owner: pekka.klarck |
|||||||||||||
,
Mar 23, 2009
We wecided to not add modules into the namespace automatically so this issue is done. Explicit is better than implicit.
Status: Done
|
|||||||||||||
,
Apr 20, 2009
(No comment was entered for this change.)
Summary: `Evaluate` keyword should take an optional list of modules to add into the namespace of the evaluated expression
|
|||||||||||||
|
|
|||||||||||||