On 30 August 2012 15:30, John Maclean <jaye...@gmail.com> wrote:

> What does the first line from `pydoc try` actually mean? This does not
> look like the syntax that one is supposed to use.
>
> try_stmt  ::= try1_stmt | try2_stmt
>

looks like part of the python language reference. It goes a little further
and explains what try1_stmt and try2_stmt actually suppose to mean:
http://docs.python.org/reference/compound_stmts.html#the-try-statement

try_stmt  ::=  try1_stmt | try2_stmt
try1_stmt ::=  "try" ":" suite
               ("except" [expression [("as" | ",") target]] ":" suite)+
               ["else" ":" suite]
               ["finally" ":" suite]
try2_stmt ::=  "try" ":" suite
               "finally" ":" suite

Let me try to rephrase it: "a try statement is either of
try-except-else-finally or of try-finally form".

This notation is used to formally describe language syntax:
http://docs.python.org/reference/introduction.html#notation

best,
Michael
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to