[Patches] [ python-Patches-1489771 ] Updates to syntax rules in reference manual

SourceForge.net noreply at sourceforge.net
Wed May 17 17:01:30 CEST 2006


Patches item #1489771, was opened at 2006-05-16 19:09
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1489771&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Žiga Seilnacht (zseil)
Assigned to: Nobody/Anonymous (nobody)
Summary: Updates to syntax rules in reference manual

Initial Comment:
I tried to update the reference manual to the current
Python syntax. Some things are still missing, most
notably the yield expression. Detailed description
of changes below. I can also attach the
generated webpages, if someone is interested.

Expressions
===========

List Displays
-------------
Reordered the rules so that the style is
consistent with the rest of the manual. Separated
listmaker into expression_list and
list_comprehension, for better readability.
Replaced "expression_list" between "for" and "in"
with "target_list". See this thread for details:
http://mail.python.org/pipermail/python-dev/2006-April/064264.html

The only thing missing is old_lambdadef.

Generator Expressions
---------------------
Simmilar as above.

Calls
-----
Fixed the latex syntax (somebody forgot to remove
a line when generators were introduced). Replaced
test with expression. Fixed allowed positions for
commas (func(*args,) is not allowed).

Boolean operations
------------------
Restructured the new conditional expression so
that it is more readable.


Simple Statements
=================

Augmented assignment statements
-------------------------------
Removed comments from "productionlist" macro,
since they broke the generated grammar.txt file.
Removed empty groups that are not needed anymore,
since automatic conversion to guillemets was
disabled. Unfortunately the escaped operator
characters would still need manual fixing in the
grammar.txt file.

The print statement
-------------------
Removed all uses of the "optional" macro and
replaced them with sqare brackets, since it broke
the generated grammar.txt file.

The import statement
--------------------
Replaced all invalid uses of name with identifier.
Added relative import notation to the grammar
section.

Description of relative imports is still needed.

The exec statement
------------------
Corrected a minor mistake, since

exec "a = 1" or "a = 2"

is not valid Python syntax.
Added a (commented out) section about a strange feature
(you can already treat exec as a function) that should
IMHO be included in documentation and its use encouraged
over the current notation.


Compound statements
===================

The with statement
------------------
Added missing macro.

Function definition
-------------------
Cleaned up "parameter_list" so that it is correct
and expresses all the restrictions, but is still
easier to understand (I hope).


Still needed
------------
Yield became an expression in version 2.5, but this
is not documented.

----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-05-17 15:01

Message:
Logged In: YES 
user_id=849994

I think the token names in the reference should not be
different from those in python/Grammar/Grammar. Aside from
this, the patch is fine.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1489771&group_id=5470


More information about the Patches mailing list