PEP-308 a "simplicity-first" alternative

Steven Taschuk staschuk at telusplanet.net
Fri Feb 14 15:57:21 EST 2003


Quoth Bengt Richter:
  [...]
> No, there is no deferral of evaluation of the {x} term once the term
> is reached to be evaluated for its normal value. This happens when it
> is used in a logical context as well as non-logical. The difference is
> that logical true is substituted for whatever the logical value would
> have been. The non-logical value is then immediately the value that continues
> as such, just as for an unwrapped value.

Ah.  Well, that clarifies my understanding some.  So, e.g., in
	{x} and y
you want the internals of 'and' *not* to call x.__nonzero__;
instead you want it to proceed as if it had been called and
returned 1.

If this is so, the braces do not change the meaning of the
expression they enclose, but the meaning of any logical operator
that has the braced expression as an argument.  If this is so, I
continue to feel that the braces give a very misleading impression
of operating on or containing the enclosed expression.

(There are instances in mathematics where contextual definitions
of this sort are used effectively; Russell's theory of
descriptions is the one that comes to mind, though if memory
serves he was inspired by something in differential calculus.  But
I can't think of a good use of such things in programming
languages.  Certainly not in ones with a recursive model of
expression evaluation.)

-- 
Steven Taschuk           |   ,\
staschuk at telusplanet.net | }<__`O=
                         |  '  "     Pleiosaur





More information about the Python-list mailing list