[Python-checkins] python/dist/src/Doc/lib libuser.tex,1.17,1.18

fdrake at users.sourceforge.net fdrake at users.sourceforge.net
Tue Dec 30 18:01:23 EST 2003


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

Modified Files:
	libuser.tex 
Log Message:
minor cleanup of example


Index: libuser.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/lib/libuser.tex,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** libuser.tex	6 Jul 2001 20:30:11 -0000	1.17
--- libuser.tex	30 Dec 2003 23:01:19 -0000	1.18
***************
*** 49,57 ****
  \begin{verbatim}
  import user
! try:
!     verbose = user.spam_verbose  # user's verbosity preference
! except AttributeError:
!     verbose = 0                  # default verbosity
  \end{verbatim}
  
  Programs with extensive customization needs are better off reading a
--- 49,59 ----
  \begin{verbatim}
  import user
! 
! verbose = bool(getattr(user, "spam_verbose", 0))
  \end{verbatim}
+ 
+ (The three-argument form of \function{getattr()} is used in case
+ the user has not defined \code{spam_verbose} in their
+ \file{.pythonrc.py} file.)
  
  Programs with extensive customization needs are better off reading a





More information about the Python-checkins mailing list