[Python-3000-checkins] r66794 - in python/branches/py3k/Doc: howto/functional.rst library/collections.rst library/reprlib.rst reference/lexical_analysis.rst

georg.brandl python-3000-checkins at python.org
Sat Oct 4 20:33:26 CEST 2008


Author: georg.brandl
Date: Sat Oct  4 20:33:26 2008
New Revision: 66794

Log:
#4000: fix several 2.x atavisms.


Modified:
   python/branches/py3k/Doc/howto/functional.rst
   python/branches/py3k/Doc/library/collections.rst
   python/branches/py3k/Doc/library/reprlib.rst
   python/branches/py3k/Doc/reference/lexical_analysis.rst

Modified: python/branches/py3k/Doc/howto/functional.rst
==============================================================================
--- python/branches/py3k/Doc/howto/functional.rst	(original)
+++ python/branches/py3k/Doc/howto/functional.rst	Sat Oct  4 20:33:26 2008
@@ -69,9 +69,9 @@
 Some languages are very strict about purity and don't even have assignment
 statements such as ``a=3`` or ``c = a + b``, but it's difficult to avoid all
 side effects.  Printing to the screen or writing to a disk file are side
-effects, for example.  For example, in Python a ``print`` statement or a
-``time.sleep(1)`` both return no useful value; they're only called for their
-side effects of sending some text to the screen or pausing execution for a
+effects, for example.  For example, in Python a call to the :func:`print` or
+:func:`time.sleep` function both return no useful value; they're only called for
+their side effects of sending some text to the screen or pausing execution for a
 second.
 
 Python programs written in functional style usually won't go to the extreme of
@@ -1031,8 +1031,8 @@
                  ...
                 ]
 
-    def get_state ((city, state)):
-        return state
+    def get_state (city_state):
+        return city_state[1]
 
     itertools.groupby(city_list, get_state) =>
       ('AL', iterator-1),

Modified: python/branches/py3k/Doc/library/collections.rst
==============================================================================
--- python/branches/py3k/Doc/library/collections.rst	(original)
+++ python/branches/py3k/Doc/library/collections.rst	Sat Oct  4 20:33:26 2008
@@ -632,7 +632,7 @@
     ...     def __str__(self):
     ...         return 'Point: x=%6.3f  y=%6.3f  hypot=%6.3f' % (self.x, self.y, self.hypot)
 
-    >>> for p in Point(3, 4), Point(14, 5/7.):
+    >>> for p in Point(3, 4), Point(14, 5/7):
     ...     print(p)
     Point: x= 3.000  y= 4.000  hypot= 5.000
     Point: x=14.000  y= 0.714  hypot=14.018

Modified: python/branches/py3k/Doc/library/reprlib.rst
==============================================================================
--- python/branches/py3k/Doc/library/reprlib.rst	(original)
+++ python/branches/py3k/Doc/library/reprlib.rst	Sat Oct  4 20:33:26 2008
@@ -126,7 +126,7 @@
            if obj.name in ['<stdin>', '<stdout>', '<stderr>']:
                return obj.name
            else:
-               return `obj`
+               return repr(obj)
 
    aRepr = MyRepr()
    print aRepr.repr(sys.stdin)          # prints '<stdin>'

Modified: python/branches/py3k/Doc/reference/lexical_analysis.rst
==============================================================================
--- python/branches/py3k/Doc/reference/lexical_analysis.rst	(original)
+++ python/branches/py3k/Doc/reference/lexical_analysis.rst	Sat Oct  4 20:33:26 2008
@@ -676,8 +676,8 @@
 
 The following tokens serve as delimiters in the grammar::
 
-   (       )       [       ]       {       }      @
-   ,       :       .       `       =       ;
+   (       )       [       ]       {       }
+   ,       :       .       ;       @       =
    +=      -=      *=      /=      //=     %=
    &=      |=      ^=      >>=     <<=     **=
 


More information about the Python-3000-checkins mailing list