[Python-checkins] CVS: python/dist/src/Doc/lib libstdtypes.tex,1.20.2.3,1.20.2.4

Fred L. Drake fdrake@weyr.cnri.reston.va.us
Wed, 1 Mar 2000 11:21:19 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Doc/lib
In directory weyr:/home/fdrake/projects/python/Doc-152p2/lib

Modified Files:
      Tag: release152p1-patches
	libstdtypes.tex 
Log Message:

Added a note to the [].append() description pointing out that
multi-arg append has been deprecated since 1.4 and noting that it will 
be removed in 1.6.

Re-ordered and re-numbered the notes for a couple of tables so that
don't seem so messy.  This has the (welcome) side effect that the note 
about [].append() is the first in it's list.


Index: libstdtypes.tex
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Doc/lib/libstdtypes.tex,v
retrieving revision 1.20.2.3
retrieving revision 1.20.2.4
diff -C2 -r1.20.2.3 -r1.20.2.4
*** libstdtypes.tex	2000/02/14 21:52:16	1.20.2.3
--- libstdtypes.tex	2000/03/01 16:21:16	1.20.2.4
***************
*** 334,341 ****
    \hline
    \lineiii{\var{s} + \var{t}}{the concatenation of \var{s} and \var{t}}{}
!   \lineiii{\var{s} * \var{n}\textrm{,} \var{n} * \var{s}}{\var{n} copies of \var{s} concatenated}{(3)}
    \hline
!   \lineiii{\var{s}[\var{i}]}{\var{i}'th item of \var{s}, origin 0}{(1)}
!   \lineiii{\var{s}[\var{i}:\var{j}]}{slice of \var{s} from \var{i} to \var{j}}{(1), (2)}
    \hline
    \lineiii{len(\var{s})}{length of \var{s}}{}
--- 334,341 ----
    \hline
    \lineiii{\var{s} + \var{t}}{the concatenation of \var{s} and \var{t}}{}
!   \lineiii{\var{s} * \var{n}\textrm{,} \var{n} * \var{s}}{\var{n} copies of \var{s} concatenated}{(1)}
    \hline
!   \lineiii{\var{s}[\var{i}]}{\var{i}'th item of \var{s}, origin 0}{(2)}
!   \lineiii{\var{s}[\var{i}:\var{j}]}{slice of \var{s} from \var{i} to \var{j}}{(2), (3)}
    \hline
    \lineiii{len(\var{s})}{length of \var{s}}{}
***************
*** 358,368 ****
  
  \begin{description}
!   
! \item[(1)] If \var{i} or \var{j} is negative, the index is relative to
    the end of the string, i.e., \code{len(\var{s}) + \var{i}} or
    \code{len(\var{s}) + \var{j}} is substituted.  But note that \code{-0} is
    still \code{0}.
    
! \item[(2)] The slice of \var{s} from \var{i} to \var{j} is defined as
    the sequence of items with index \var{k} such that \code{\var{i} <=
    \var{k} < \var{j}}.  If \var{i} or \var{j} is greater than
--- 358,371 ----
  
  \begin{description}
! \item[(1)] Values of \var{n} less than \code{0} are treated as
!   \code{0} (which yields an empty sequence of the same type as
!   \var{s}).
! 
! \item[(2)] If \var{i} or \var{j} is negative, the index is relative to
    the end of the string, i.e., \code{len(\var{s}) + \var{i}} or
    \code{len(\var{s}) + \var{j}} is substituted.  But note that \code{-0} is
    still \code{0}.
    
! \item[(3)] The slice of \var{s} from \var{i} to \var{j} is defined as
    the sequence of items with index \var{k} such that \code{\var{i} <=
    \var{k} < \var{j}}.  If \var{i} or \var{j} is greater than
***************
*** 370,378 ****
    use \code{0}.  If \var{j} is omitted, use \code{len(\var{s})}.  If
    \var{i} is greater than or equal to \var{j}, the slice is empty.
- 
- \item[(3)] Values of \var{n} less than \code{0} are treated as
-   \code{0} (which yields an empty sequence of the same type as
-   \var{s}).
- 
  \end{description}
  
--- 373,376 ----
***************
*** 454,464 ****
  	{same as \code{\var{s}[\var{i}:\var{j}] = []}}{}
    \lineiii{\var{s}.append(\var{x})}
! 	{same as \code{\var{s}[len(\var{s}):len(\var{s})] = [\var{x}]}}{}
    \lineiii{\var{s}.extend(\var{x})}
!         {same as \code{\var{s}[len(\var{s}):len(\var{s})] = \var{x}}}{(5)}
    \lineiii{\var{s}.count(\var{x})}
      {return number of \var{i}'s for which \code{\var{s}[\var{i}] == \var{x}}}{}
    \lineiii{\var{s}.index(\var{x})}
!     {return smallest \var{i} such that \code{\var{s}[\var{i}] == \var{x}}}{(1)}
    \lineiii{\var{s}.insert(\var{i}, \var{x})}
  	{same as \code{\var{s}[\var{i}:\var{i}] = [\var{x}]}
--- 452,462 ----
  	{same as \code{\var{s}[\var{i}:\var{j}] = []}}{}
    \lineiii{\var{s}.append(\var{x})}
! 	{same as \code{\var{s}[len(\var{s}):len(\var{s})] = [\var{x}]}}{(1)}
    \lineiii{\var{s}.extend(\var{x})}
!         {same as \code{\var{s}[len(\var{s}):len(\var{s})] = \var{x}}}{(2)}
    \lineiii{\var{s}.count(\var{x})}
      {return number of \var{i}'s for which \code{\var{s}[\var{i}] == \var{x}}}{}
    \lineiii{\var{s}.index(\var{x})}
!     {return smallest \var{i} such that \code{\var{s}[\var{i}] == \var{x}}}{(3)}
    \lineiii{\var{s}.insert(\var{i}, \var{x})}
  	{same as \code{\var{s}[\var{i}:\var{i}] = [\var{x}]}
***************
*** 467,475 ****
      {same as \code{\var{x} = \var{s}[\var{i}]; del \var{s}[\var{i}]; return \var{x}}}{(4)}
    \lineiii{\var{s}.remove(\var{x})}
! 	{same as \code{del \var{s}[\var{s}.index(\var{x})]}}{(1)}
    \lineiii{\var{s}.reverse()}
! 	{reverses the items of \var{s} in place}{(3)}
    \lineiii{\var{s}.sort(\optional{\var{cmpfunc}})}
! 	{sort the items of \var{s} in place}{(2), (3)}
  \end{tableiii}
  \indexiv{operations on}{mutable}{sequence}{types}
--- 465,473 ----
      {same as \code{\var{x} = \var{s}[\var{i}]; del \var{s}[\var{i}]; return \var{x}}}{(4)}
    \lineiii{\var{s}.remove(\var{x})}
! 	{same as \code{del \var{s}[\var{s}.index(\var{x})]}}{(3)}
    \lineiii{\var{s}.reverse()}
! 	{reverses the items of \var{s} in place}{(5)}
    \lineiii{\var{s}.sort(\optional{\var{cmpfunc}})}
! 	{sort the items of \var{s} in place}{(5), (6)}
  \end{tableiii}
  \indexiv{operations on}{mutable}{sequence}{types}
***************
*** 486,493 ****
  Notes:
  \begin{description}
! \item[(1)] Raises \exception{ValueError} when \var{x} is not found in
    \var{s}.
  
! \item[(2)] The \method{sort()} method takes an optional argument
    specifying a comparison function of two arguments (list items) which
    should return \code{-1}, \code{0} or \code{1} depending on whether
--- 484,510 ----
  Notes:
  \begin{description}
! \item[(1)] The C implementation of Python has historically accepted
!   multiple parameters and implicitly joined them into a tuple; this
!   will no longer work in Python 1.6.  Use of this misfeature has been
!   deprecated since Python 1.4.
! 
! \item[(2)] Raises an exception when \var{x} is not a list object.  The 
!   \method{extend()} method is experimental and not supported by
!   mutable sequence types other than lists.
! 
! \item[(3)] Raises \exception{ValueError} when \var{x} is not found in
    \var{s}.
+ 
+ \item[(4)] The \method{pop()} method is experimental and not supported 
+   by other mutable sequence types than lists.  The optional argument
+   \var{i} defaults to \code{-1}, so that by default the last item is
+   removed and returned.
  
! \item[(5)] The \method{sort()} and \method{reverse()} methods modify the
!   list in place for economy of space when sorting or reversing a large
!   list.  They don't return the sorted or reversed list to remind you
!   of this side effect.
! 
! \item[(6)] The \method{sort()} method takes an optional argument
    specifying a comparison function of two arguments (list items) which
    should return \code{-1}, \code{0} or \code{1} depending on whether
***************
*** 499,516 ****
    \function{sort()} with a comparison function that reverses the
    ordering of the elements.
- 
- \item[(3)] The \method{sort()} and \method{reverse()} methods modify the
-   list in place for economy of space when sorting or reversing a large
-   list.  They don't return the sorted or reversed list to remind you
-   of this side effect.
- 
- \item[(4)] The \method{pop()} method is experimental and not supported 
-   by other mutable sequence types than lists.  The optional argument
-   \var{i} defaults to \code{-1}, so that by default the last item is
-   removed and returned.
- 
- \item[(5)] Raises an exception when \var{x} is not a list object.  The 
-   \method{extend()} method is experimental and not supported by
-   mutable types other than lists.
  \end{description}
  
--- 516,519 ----



Return-Path: <gward@newcnri.cnri.reston.va.us>
Delivered-To: python-checkins@python.org
Received: from cnri.reston.va.us (ns.CNRI.Reston.VA.US [132.151.1.1])
	by dinsdale.python.org (Postfix) with ESMTP id 6A4371CE85
	for <python-checkins@python.org>; Wed,  1 Mar 2000 13:58:00 -0500 (EST)
Received: from newcnri.cnri.reston.va.us (newcnri [132.151.1.84])
	by cnri.reston.va.us (8.9.1a/8.9.1) with ESMTP id NAA25742
	for <python-checkins@python.org>; Wed, 1 Mar 2000 13:58:00 -0500 (EST)
Received: from thrak.cnri.reston.va.us (thrak.cnri.reston.va.us [10.27.10.43])
	by newcnri.cnri.reston.va.us (8.9.1b+Sun/8.9.1) with ESMTP id NAA08809
	for <python-checkins@python.org>; Wed, 1 Mar 2000 13:59:51 -0500 (EST)
Received: (from gward@localhost)
	by thrak.cnri.reston.va.us (8.8.8+Sun/8.8.8) id NAA22564
	for python-checkins@python.org; Wed, 1 Mar 2000 13:59:50 -0500 (EST)
Date: Wed, 1 Mar 2000 13:59:50 -0500 (EST)
From: Greg Ward <gward@cnri.reston.va.us>
Message-Id: <200003011859.NAA22564@thrak.cnri.reston.va.us>
To: python-checkins@python.org
Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.124,2.125
Sender: python-checkins-admin@python.org
Errors-To: python-checkins-admin@python.org
X-BeenThere: python-checkins@python.org
X-Mailman-Version: 1.2 (beta 1)
Precedence: bulk
List-Id: Check-in messages from the Python maintainers <python-checkins.python.org>

Update of /projects/cvsroot/python/dist/src/Modules
In directory thrak:/scratch/python/src/Modules

Modified Files:
	posixmodule.c 
Log Message:
Fix compiler warning: only use "_r" form of 'ctermid()' and 'tmpnam()' when
building a threaded Python.

Index: posixmodule.c
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Modules/posixmodule.c,v
retrieving revision 2.124
retrieving revision 2.125
diff -C2 -r2.124 -r2.125
*** posixmodule.c	2000/02/25 17:51:00	2.124
--- posixmodule.c	2000/03/01 18:59:47	2.125
***************
*** 650,654 ****
  		return NULL;
  
! #ifdef HAVE_CTERMID_R
  	ret = ctermid_r(buffer);
  #else
--- 650,654 ----
  		return NULL;
  
! #if defined(HAVE_CTERMID_R) && defined(WITH_THREAD)
  	ret = ctermid_r(buffer);
  #else
***************
*** 3343,3347 ****
      if (!PyArg_ParseTuple(args, ":tmpnam"))
          return NULL;
! #ifdef HAVE_TMPNAM_R
      name = tmpnam_r(buffer);
  #else
--- 3343,3347 ----
      if (!PyArg_ParseTuple(args, ":tmpnam"))
          return NULL;
! #if defined(HAVE_TMPNAM_R) && defined(WITH_THREAD)
      name = tmpnam_r(buffer);
  #else