I think trying to eager-ify subexpressions is absurdly difficult to do
right, and also a problem that occurs in other places in Python already, so
solving it only for this new thing that might very well go no further is a
bit odd.

I don't think versions that aren't transparent are much use.

> Interesting. Okay. So in effect, these things aren't objects, they're
magic constructs that turn into objects the moment you do anything
with them, even an identity check. That makes sense.

This seems unfortunate. Why not make these things objects that replace
themselves with the evaluated-to object when they're used?

> "this collapses the waveform, that keeps it in a quantum state"

That's a bit of a false dichotomy ;)

I suggest that operators on delayed-objects defer evaluation iff all of
their operands are delayed, with some hopefully-obvious exceptions:
- Function call: delayed_thing() should evaluate delayed_thing
- Attribute and item access should evaluate the container and key: even if
both operands are delayed, in Python we have to assume things are mutable
(especially if we don't know what they are yet), so we can't guarantee that
delaying the lookup is valid.

Just passing something to a function shouldn't collapse it. That'd make
this completely useless.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to