PEP 312 (and thus 308) implemented with a black magic trick

Erik Max Francis max at alcyone.com
Mon Mar 17 19:03:33 EST 2003


Michele Simionato wrote:

> Notice that instead of the proposed colon notation for PEP 312
> (:x as a shortcut for lambda :x) I use a tilde notation:
> 
> ~x as a shortcut for lambda :x
> 
> This means that I am changing the semantics of the unary operator
> "~", which is a Bad Thing: but as I said, this is dirty trick ;)

How does this suggestion different from the use of a single colon in PEP
312, except that this invalidates a previously existing legitimate
behavior?  It has exactly the same benefits and drawbacks of PEP 312,
except with the introduction of an additional drawback.

Furthermore, if you change the meaning of ~, what operator now becomes
used to represent bitwise negation?

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ It is human nature to think wisely and act foolishly.
\__/ Anatole France
    Church / http://www.alcyone.com/pyos/church/
 A lambda calculus explorer in Python.




More information about the Python-list mailing list