/ Hathaway Weblog / Python-Dev: Spectator Sport

Shane :: Python :: April 22, 2005 # Python-Dev: Spectator Sport

I'm getting a kick out of watching the discussions on Python-Dev, the mailing list for Python development. It's fun to see a new syntax proposal, evaluate it on my own, and try to predict the reaction by the group. Watching in real time makes it more fun.

For example, here's a syntax that was just suggested by Nick Coghlan:

def my_resource():
  print "Hi!"   # Do entrance code
  continue      # Go on with the contents of the 'with' block
  print "Bye!"  # Do exit code 

The intent is to integrate this into PEP 310. The word "continue" is a very appropriate English word, and the syntax is technically unambiguous. However, there's some risk that coders will misplace the continue keyword in code not intended to be used as a resource, causing a "def" statement to surprisingly generate a resource rather than a function. My guess is that risk is not large enough to dismiss the idea, and some other risk will make it more controversial. I wonder what it will be. The level of insightfulness among the group is incredible.

Comments

Shane Hathaway (April 23, 2005 22:33)

Ah, here's the problem: if the continue keyword happens to be in a loop, the code becomes a normal function rather than a block handler. It would be an easy mistake. Too bad.

Someone pointed out that PEP 310 gets us fairly close to Lisp-like macros. Interesting. And I just read an article (discovered via windley.com) that suggests Python is a dialect of Lisp.

No further comments may be added.

Abraham 3:22-23 (Click below to fill in the blanks.)
Your browser is not able to display the scripture fill-in program. To see it, enable Javascript or use Mozilla 1.0 or better.

Church: lds scriptures provident games pearls kzion shiblon film chancellor gateway cumorah byutv happiness nephi
Zope: freezope org com zen labs newbies zettai warnes
Python: home pyzine daily icanprogram
Genealogy: cyndi
Weblogs: jeffrey paul jon joel another-shane guido barry jeremy windley chrism zac
News: quakes lwn dc weather deseret zeitgeist softwarelivre
Zaurus: software developer
Tech: tango spintronics thin
Semantic: aaron sean
Reference: css rdf html4 javascript geckodom iecss emacs phrases acronyms
Reverse: advogato slashdot
Misc: gimp-savvy directory soda jokes shouldexist pdphoto