Wrapping classes

Jeremy Sanders jeremy+complangpython at jeremysanders.net
Fri Sep 23 11:37:37 CEST 2005


Peter Hansen wrote:
 
> Almost anything is possible in Python, though whether the underlying
> design idea is sound is a completely different question.  (Translation:
> try the following pseudo-code, but I have my suspicions about whether
> what you're doing is a good idea. :-) )

What I'd like to do precisely is to be able to evaluate an expression like
"a+2*b" (using eval) where a and b are objects which behave like numarray
arrays, but whose values aren't computed until their used.

I need to compute the values when used because the arrays could depend on
each other, and the easiest way to get the evaluation order correct is to
only evaluate them when they're used.

An alternative way is to do some string processing to replace a with
computearray("a") in the expression or something horrible like that.

Thanks

Jeremy

-- 
Jeremy Sanders
http://www.jeremysanders.net/



More information about the Python-list mailing list