[Python-3000-checkins] r57923 - python/branches/py3k/Doc/tutorial/classes.rst python/branches/py3k/Doc/tutorial/controlflow.rst python/branches/py3k/Doc/tutorial/datastructures.rst python/branches/py3k/Doc/tutorial/inputoutput.rst python/branches/py3k/Doc/tutorial/introduction.rst python/branches/py3k/Doc/tutorial/modules.rst python/branches/py3k/Doc/tutorial/stdlib2.rst

georg.brandl python-3000-checkins at python.org
Mon Sep 3 09:10:25 CEST 2007


Author: georg.brandl
Date: Mon Sep  3 09:10:24 2007
New Revision: 57923

Modified:
   python/branches/py3k/Doc/tutorial/classes.rst
   python/branches/py3k/Doc/tutorial/controlflow.rst
   python/branches/py3k/Doc/tutorial/datastructures.rst
   python/branches/py3k/Doc/tutorial/inputoutput.rst
   python/branches/py3k/Doc/tutorial/introduction.rst
   python/branches/py3k/Doc/tutorial/modules.rst
   python/branches/py3k/Doc/tutorial/stdlib2.rst
Log:
Tutorial formatting patch by Robin Stocker.


Modified: python/branches/py3k/Doc/tutorial/classes.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/classes.rst	(original)
+++ python/branches/py3k/Doc/tutorial/classes.rst	Mon Sep  3 09:10:24 2007
@@ -769,7 +769,7 @@
    >>> valedictorian = max((student.gpa, student.name) for student in graduates)
 
    >>> data = 'golf'
-   >>> list(data[i] for i in range(len(data)-1,-1,-1))
+   >>> list(data[i] for i in range(len(data)-1, -1, -1))
    ['f', 'l', 'o', 'g']
 
 

Modified: python/branches/py3k/Doc/tutorial/controlflow.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/controlflow.rst	(original)
+++ python/branches/py3k/Doc/tutorial/controlflow.rst	Mon Sep  3 09:10:24 2007
@@ -210,7 +210,7 @@
    ...     """Print a Fibonacci series up to n."""
    ...     a, b = 0, 1
    ...     while b < n:
-   ...         print(b,end=' ')
+   ...         print(b, end=' ')
    ...         a, b = b, a+b
    ...     print()
    ... 
@@ -389,7 +389,7 @@
 value``.  For instance, the following function::
 
    def parrot(voltage, state='a stiff', action='voom', type='Norwegian Blue'):
-       print("-- This parrot wouldn't", action, end= ' ')
+       print("-- This parrot wouldn't", action, end=' ')
        print("if you put", voltage, "volts through it.")
        print("-- Lovely plumage, the", type)
        print("-- It's", state, "!")
@@ -481,7 +481,7 @@
 parameters, because they scoop up all remaining input arguments that are 
 passed to the function. Any formal parameters which occur after the ``*args``
 parameter are 'keyword-only' arguments, meaning that they can only be used as 
-keywords rather than positional arguments.::
+keywords rather than positional arguments. ::
  
    >>> def concat(*args, sep="/"):
    ...    return sep.join(args)
@@ -513,7 +513,7 @@
 -operator::
 
    >>> def parrot(voltage, state='a stiff', action='voom'):
-   ...     print("-- This parrot wouldn't", action,end=' ')
+   ...     print("-- This parrot wouldn't", action, end=' ')
    ...     print("if you put", voltage, "volts through it.", end=' ')
    ...     print("E's", state, "!")
    ...

Modified: python/branches/py3k/Doc/tutorial/datastructures.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/datastructures.rst	(original)
+++ python/branches/py3k/Doc/tutorial/datastructures.rst	Mon Sep  3 09:10:24 2007
@@ -234,7 +234,7 @@
 
 Now we get a little fancier::
 
-   >>> [[x,x**2] for x in vec]
+   >>> [[x, x**2] for x in vec]
    [[2, 4], [4, 16], [6, 36]]
 
 Here we apply a method call to each item in a sequence::
@@ -243,7 +243,7 @@
    >>> [weapon.strip() for weapon in freshfruit]
    ['banana', 'loganberry', 'passion fruit']
 
-Using the if-clause we can filter the stream::
+Using the :keyword:`if` clause we can filter the stream::
 
    >>> [3*x for x in vec if x > 3]
    [12, 18]
@@ -260,7 +260,7 @@
    >>> [(x, x**2) for x in vec]
    [(2, 4), (4, 16), (6, 36)]
 
-Here are some nested for's and other fancy behavior::
+Here are some nested for loops and other fancy behavior::
 
    >>> vec1 = [2, 4, 6]
    >>> vec2 = [4, 3, -9]
@@ -273,7 +273,7 @@
 
 List comprehensions can be applied to complex expressions and nested functions::
 
-   >>> [str(round(355/113.0, i)) for i in range(1,6)]
+   >>> [str(round(355/113.0, i)) for i in range(1, 6)]
    ['3.1', '3.14', '3.142', '3.1416', '3.14159']
 
 
@@ -469,7 +469,7 @@
 To loop over a sequence in reverse, first specify the sequence in a forward
 direction and then call the :func:`reversed` function. ::
 
-   >>> for i in reversed(range(1,10,2)):
+   >>> for i in reversed(range(1, 10, 2)):
    ...     print(i)
    ...
    9

Modified: python/branches/py3k/Doc/tutorial/inputoutput.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/inputoutput.rst	(original)
+++ python/branches/py3k/Doc/tutorial/inputoutput.rst	Mon Sep  3 09:10:24 2007
@@ -78,7 +78,7 @@
 Here are two ways to write a table of squares and cubes::
 
    >>> for x in range(1, 11):
-   ...     print(repr(x).rjust(2), repr(x*x).rjust(3),end=' ')
+   ...     print(repr(x).rjust(2), repr(x*x).rjust(3), end=' ')
    ...     # Note use of 'end' on previous line
    ...     print(repr(x*x*x).rjust(4))
    ...
@@ -93,7 +93,7 @@
     9  81  729
    10 100 1000
 
-   >>> for x in range(1,11):
+   >>> for x in range(1, 11):
    ...     print('%2d %3d %4d' % (x, x*x, x*x*x))
    ... 
     1   1    1

Modified: python/branches/py3k/Doc/tutorial/introduction.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/introduction.rst	(original)
+++ python/branches/py3k/Doc/tutorial/introduction.rst	Mon Sep  3 09:10:24 2007
@@ -111,7 +111,7 @@
 
    >>> 1j * 1J
    (-1+0j)
-   >>> 1j * complex(0,1)
+   >>> 1j * complex(0, 1)
    (-1+0j)
    >>> 3+1j*3
    (3+3j)
@@ -271,8 +271,9 @@
 
 Strings can be subscripted (indexed); like in C, the first character of a string
 has subscript (index) 0.  There is no separate character type; a character is
-simply a string of size one.  As in Icon, substrings can be specified with the
-*slice notation*: two indices separated by a colon. ::
+simply a string of size one.  As in the Icon programming language, substrings
+can be specified with the *slice notation*: two indices separated by a colon.
+::
 
    >>> word[4]
    'A'
@@ -523,7 +524,7 @@
 
 You can add something to the end of the list::
 
-   >>> p[1].append('xtra')    
+   >>> p[1].append('xtra')
    >>> p
    [1, [2, 3, 'xtra'], 4]
    >>> q

Modified: python/branches/py3k/Doc/tutorial/modules.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/modules.rst	(original)
+++ python/branches/py3k/Doc/tutorial/modules.rst	Mon Sep  3 09:10:24 2007
@@ -224,9 +224,9 @@
   files when :option:`-O` is used) for all modules in a directory.
 
 * If using Python in a parallel processing system with a shared file system,
-  you need to patch python to disable the creation of the compiled files 
+  you need to patch Python to disable the creation of the compiled files 
   because otherwise the multiple Python interpreters will encounter race 
-  conditions in creating them. 
+  conditions in creating them.
 
 
 .. _tut-standardmodules:

Modified: python/branches/py3k/Doc/tutorial/stdlib2.rst
==============================================================================
--- python/branches/py3k/Doc/tutorial/stdlib2.rst	(original)
+++ python/branches/py3k/Doc/tutorial/stdlib2.rst	Mon Sep  3 09:10:24 2007
@@ -184,7 +184,7 @@
            f = zipfile.ZipFile(self.outfile, 'w', zipfile.ZIP_DEFLATED)
            f.write(self.infile)
            f.close()
-           print('Finished background zip of: ', self.infile)
+           print('Finished background zip of:', self.infile)
 
    background = AsyncZip('mydata.txt', 'myarchive.zip')
    background.start()


More information about the Python-3000-checkins mailing list