[Python-3000] Test and Assign [was: More wishful thinking]

Bill Janssen janssen at parc.com
Mon Apr 17 23:24:02 CEST 2006


> Unless you have a concrete solution (short of allowing '=' in
> expressions :-) there's no solution and you're wasting everybody's
> time for explaining how useful it would be.

If we had symbols, we could write something like

    if assign('x, some_expression):
       print x

Presumably a reference to a Python symbol would be not just the symbol
name string, but also an indicator of the namespace of the symbol.

But frankly, I don't think symbols would bring much else to Python,
and I'm -1 on adding them.  It seems to me that something very like
the above can already be done with partial function application.  It
could even be regularized/automated with a bit of metaclass hacking.

Bill


More information about the Python-3000 mailing list