Pythoncal, anyone? (My (late) beef with Simple Generator syntax (PEP 255))

Greg Ewing see_reply_address at something.invalid
Sun Nov 17 21:26:34 EST 2002


I have an idea: Suppose there were a "don't"
statement that could be put in front of another
statement to, effectively, comment it out,
e.g.

  def foo():
    # This function does nothing
    don't print "Hello"

Then an empty generator could be written

  def g():
    don't yield None

Now, since this isn't going to do anything,
it should be permissible to omit any expressions
that would otherwise be required in a statement
covered by a "don't", leaving just

  def g():
    don't yield

-- 
Greg Ewing, Computer Science Dept,
University of Canterbury,	
Christchurch, New Zealand
http://www.cosc.canterbury.ac.nz/~greg




More information about the Python-list mailing list