[Python-Dev] ',' precedence in documentation] (original) (raw)

Guido van Rossum guido at python.org
Mon Sep 15 18:19:53 CEST 2008


On Mon, Sep 15, 2008 at 8:14 AM, Joel Bender <jjb5 at cornell.edu> wrote:

Guido van Rossum wrote:

...the syntax for "expression" doesn't allow a comma unless it's inside parentheses. Perhaps a source of confusion might be that comma seems to act like a 'tuple join operator' when it is not inside parentheses.

Um, the question I was answering specifically asked where is this in the docs.

And there is at least one point in the documentation where the comma is described as an operator:

<http://docs.python.org/ref/parenthesized.html> "Note that tuples are not formed by the parentheses, but rather by use of the comma operator."

Good sleuthing. Since you have found an inconsistency, now all the docs are useless?

As for the assert syntax, I would reuse the 'raise' keyword rather than 'else':

assertstmt ::= "assert" [ "raise" ] Which emphasizes that the expression is raised as an exception.

But it is not -- it is the message passed to the exception constructor!

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list