Python keywords vs. English grammar

Roy Smith roy at panix.com
Wed May 24 08:57:33 EDT 2006


I noticed something interesting today.  In C++, you write:

try {
   throw foo;
} catch {
}

and all three keywords are verbs, so when you describe the code, you can 
use the same English words as in the program source, "You try to execute 
some code, but it throws a foo, which is caught by the handler".

In Python, you write:

try:
   raise foo
except:

and now you've got a mix of verbs and (I think), a preposition.  You can't 
say, "You try to execute some code, but it raises a foo, which is excepted 
by the handler".  It just doesn't work grammatically.

Sigh.



More information about the Python-list mailing list