Python keywords vs. English grammar
Rony Steelandt
bucodi at yahoo.fr.invalid
Wed May 24 09:11:58 EDT 2006
I'm not a english speaker, so I just accepted it...;
I understood it as :
'Try' allways to execute this code, 'except' when it doesn't work do
this....
> 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.
--
---
Rony Steelandt
BuCodi
rony dot steelandt (at) bucodi dot com
Visit the python blog at http://360.yahoo.com/bucodi
More information about the Python-list
mailing list