[Python-checkins] CVS: python/dist/src/Doc/lib libdoctest.tex,1.4,1.5

Fred L. Drake fdrake@users.sourceforge.net
Thu, 22 Feb 2001 15:15:07 -0800


Update of /cvsroot/python/python/dist/src/Doc/lib
In directory usw-pr-cvs1:/tmp/cvs-serv10916/lib

Modified Files:
	libdoctest.tex 
Log Message:

Work around the broken formatting of sys.ps1 prompts in running text.

Move sample sessions to the left margin of the file for consistency;
formatting can adjust the margin if needed.

This closes SF bug #133213.


Index: libdoctest.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdoctest.tex,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** libdoctest.tex	2001/02/20 10:57:30	1.4
--- libdoctest.tex	2001/02/22 23:15:05	1.5
***************
*** 227,235 ****
  
  \begin{verbatim}
!     >>> [1, 2, 3].remove(42)
!     Traceback (most recent call last):
!       File "<stdin>", line 1, in ?
!     ValueError: list.remove(x): x not in list
!     >>>
  \end{verbatim}
  
--- 227,235 ----
  
  \begin{verbatim}
! >>> [1, 2, 3].remove(42)
! Traceback (most recent call last):
!   File "<stdin>", line 1, in ?
! ValueError: list.remove(x): x not in list
! >>>
  \end{verbatim}
  
***************
*** 258,281 ****
  
  \begin{verbatim}
!     >>> # comments are ignored
!     >>> x = 12
!     >>> x
!     12
!     >>> if x == 13:
!     ...     print "yes"
!     ... else:
!     ...     print "no"
!     ...     print "NO"
!     ...     print "NO!!!"
!     ...
!     no
!     NO
!     NO!!!
!     >>>
! \end{verbatim}
! 
! Any expected output must immediately follow the final \code{">>>"} or
! \code{"..."} line containing the code, and the expected output (if any)
! extends to the next \code{">>>"} or all-whitespace line.
  
  The fine print:
--- 258,282 ----
  
  \begin{verbatim}
! >>> # comments are ignored
! >>> x = 12
! >>> x
! 12
! >>> if x == 13:
! ...     print "yes"
! ... else:
! ...     print "no"
! ...     print "NO"
! ...     print "NO!!!"
! ...
! no
! NO
! NO!!!
! >>>
! \end{verbatim}
! 
! Any expected output must immediately follow the final
! \code{'>\code{>}>~'} or \code{'...~'} line containing the code, and
! the expected output (if any) extends to the next \code{'>\code{>}>~'}
! or all-whitespace line.
  
  The fine print:
***************
*** 311,316 ****
  \end{verbatim}
  
! and as many leading whitespace characters are stripped from the expected
! output as appeared in the initial ">>>" line that triggered it.
  \end{itemize}
  
--- 312,318 ----
  \end{verbatim}
  
! and as many leading whitespace characters are stripped from the
! expected output as appeared in the initial \code{'>\code{>}>~'} line
! that triggered it.
  \end{itemize}
  
***************
*** 350,356 ****
  % Tim: ask Guido -- it's his example!
  \begin{verbatim}
!     >>> foo()
!     {"Hermione": "hippogryph", "Harry": "broomstick"}
!     >>>
  \end{verbatim}
  
--- 352,358 ----
  % Tim: ask Guido -- it's his example!
  \begin{verbatim}
! >>> foo()
! {"Hermione": "hippogryph", "Harry": "broomstick"}
! >>>
  \end{verbatim}
  
***************
*** 358,364 ****
  
  \begin{verbatim}
!     >>> foo() == {"Hermione": "hippogryph", "Harry": "broomstick"}
!     1
!     >>>
  \end{verbatim}
  
--- 360,366 ----
  
  \begin{verbatim}
! >>> foo() == {"Hermione": "hippogryph", "Harry": "broomstick"}
! 1
! >>>
  \end{verbatim}
  
***************
*** 366,373 ****
  
  \begin{verbatim}
!     >>> d = foo().items()
!     >>> d.sort()
!     >>> d
!     [('Harry', 'broomstick'), ('Hermione', 'hippogryph')]
  \end{verbatim}
  
--- 368,375 ----
  
  \begin{verbatim}
! >>> d = foo().items()
! >>> d.sort()
! >>> d
! [('Harry', 'broomstick'), ('Hermione', 'hippogryph')]
  \end{verbatim}
  
***************
*** 377,383 ****
  
  \begin{verbatim}
!     >>> id(1.0) # certain to fail some of the time
!     7948648
!     >>>
  \end{verbatim}
  
--- 379,385 ----
  
  \begin{verbatim}
! >>> id(1.0) # certain to fail some of the time
! 7948648
! >>>
  \end{verbatim}
  
***************
*** 387,396 ****
  
  \begin{verbatim}
!     >>> 1./7  # risky
!     0.14285714285714285
!     >>> print 1./7 # safer
!     0.142857142857
!     >>> print round(1./7, 6) # much safer
!     0.142857
  \end{verbatim}
  
--- 389,398 ----
  
  \begin{verbatim}
! >>> 1./7  # risky
! 0.14285714285714285
! >>> print 1./7 # safer
! 0.142857142857
! >>> print round(1./7, 6) # much safer
! 0.142857
  \end{verbatim}
  
***************
*** 399,404 ****
  
  \begin{verbatim}
!     >>> 3./4  # utterly safe
!     0.75
  \end{verbatim}
  
--- 401,406 ----
  
  \begin{verbatim}
! >>> 3./4  # utterly safe
! 0.75
  \end{verbatim}