* Guido van Rossum <[EMAIL PROTECTED]> [2007-04-29 18:19:20 -0700]: > > In my mind, 'if' and 'or' are "syntax", whereas things like 'None' or > > 'True' are "values"; even if None becomes an actual keyword, rather than > > a builtin. > > I'm sorry, but that is such an incredibly subjective difference that I > can't do anything with it. String literals and numeric literals are > syntax too, even though they are values. A keyword, or reserved word, > is simply something that looks like an identifier but is converted > into a different token (by the lexer or by something sitting between > the lexer and the parse) before the parser sees it.
Let me try a less subjective description. Things like None, 2.3, 'foo', True are values or "expressions"; I'm not certain exactly what the term for these is in Python's grammar, but I basically mean something that can be on the RHS of an assignment.. However, something like 'for' or 'if' is part of some other grammatical construct, generally a statement or operator of some kind, so I tend to think of those differently. -- mithrandi, i Ainil en-Balandor, a faer Ambar
signature.asc
Description: Digital signature
_______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com