self
Fernando Pérez
fperez528 at yahoo.com
Thu Jun 6 05:00:19 EDT 2002
Vojin Jovanovic wrote:
>> So ':=' variables would first try to evaluate their expressions in their
>> normal namespace (that of the class, the problem you're dealing with now)
> and
>> would then look for 'normal' variable names to resolve. Only if a name
>> wasnt't found in either would a NameError be raised.
>
> Your idea is good. It would be exactly what I need. It would bring a lot
> to python; a kind of symbolic manipulation capability. Unfortunately, I
> don't think that my current knowledge of Python is sufficient to implement
> this in a general way you are suggesting.
Well, I've given it a bit of thought on the side but unfortunately right now
I'm swamped with other things. I'll put it in the idea-bucket for IPython,
hopefully later I'll have a chance to look at it. By the way, the ':=' part
is absolutely trivial to implement for me, the tricky side is the problem
you've been struggling with. So if you ever can build a class which evaluates
the way you've been trying, I could easily incorporate it into the ipython
framework with a special syntax pre-processor (I already have that
infrastructure in place).
But the problem is not trivial, esp. if you want to be able to mix and match
'normal' python variables with these 'delayed evaluation' ones. Good luck :)
f
More information about the Python-list
mailing list