was: Take 2: PEP draft for expression embedding

Steven Majewski sdm7g at Virginia.EDU
Wed Dec 19 20:31:56 EST 2001


On Wed, 19 Dec 2001, Steven Majewski wrote:

> I'm just pasting this from a python session: the class needs a descriptive
> name:  class EvaluatingDict ?
>
> >>> e = D(locals())
> >>> e['sin']
> <built-in function sin>
> >>> e['x']
> 0.5
> >>> e['sin(x)']
> 0.47942553860420301


And if you tried to reproduce that example, I hope it was obvious
that the lines that I left out were:

>>> from math import *
>>> x = 0.5


-- Steve






More information about the Python-list mailing list