[Python-checkins] python/dist/src/Doc/api utilities.tex,1.5,1.5.2.1 refcounts.dat,1.43,1.43.2.1 newtypes.tex,1.13,1.13.2.1 init.tex,1.3,1.3.2.1 exceptions.tex,1.7,1.7.2.1 concrete.tex,1.17,1.17.2.1 abstract.tex,1.17,1.17.2.1

jhylton@users.sourceforge.net jhylton@users.sourceforge.net
Mon, 28 Apr 2003 10:39:51 -0700


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

Modified Files:
      Tag: ast-branch
	utilities.tex refcounts.dat newtypes.tex init.tex 
	exceptions.tex concrete.tex abstract.tex 
Log Message:
Merge head to this branch.

Merge all sorts of changes from just before 2.3b1 into the ast
branch.  This should make the eventual merge back to the trunk easier.

The merge is almost entirely porting changes into the ast-branch.
There was no attempt to get changes to compile.c into newcompile.c.
That work should be done when newcompile.c is closer to completion.

The only significant conflicts appeared to be in pythonrun.c.


Index: utilities.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/utilities.tex,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -d -r1.5 -r1.5.2.1
*** utilities.tex	17 Jun 2002 15:44:18 -0000	1.5
--- utilities.tex	28 Apr 2003 17:38:10 -0000	1.5.2.1
***************
*** 59,63 ****
  \section{Process Control \label{processControl}}
  
! \begin{cfuncdesc}{void}{Py_FatalError}{char *message}
    Print a fatal error message and kill the process.  No cleanup is
    performed.  This function should only be invoked when a condition is
--- 59,63 ----
  \section{Process Control \label{processControl}}
  
! \begin{cfuncdesc}{void}{Py_FatalError}{const char *message}
    Print a fatal error message and kill the process.  No cleanup is
    performed.  This function should only be invoked when a condition is
***************
*** 149,156 ****
    First check the modules dictionary if there's one there, and if not,
    create a new one and insert in in the modules dictionary.
    \note{This function does not load or import the module; if the
    module wasn't already loaded, you will get an empty module object.
    Use \cfunction{PyImport_ImportModule()} or one of its variants to
!   import a module.  Return \NULL{} with an exception set on failure.}
  \end{cfuncdesc}
  
--- 149,158 ----
    First check the modules dictionary if there's one there, and if not,
    create a new one and insert in in the modules dictionary.
+   Return \NULL{} with an exception set on failure.
    \note{This function does not load or import the module; if the
    module wasn't already loaded, you will get an empty module object.
    Use \cfunction{PyImport_ImportModule()} or one of its variants to
!   import a module.  Package structures implied by a dotted name for
!   \var{name} are not created if not already present.}
  \end{cfuncdesc}
  
***************
*** 161,166 ****
    the module.  Return a new reference to the module object, or \NULL{}
    with an exception set if an error occurred (the module may still be
!   created in this case).  (This function would reload the module if it
!   was already imported.)
  \end{cfuncdesc}
  
--- 163,170 ----
    the module.  Return a new reference to the module object, or \NULL{}
    with an exception set if an error occurred (the module may still be
!   created in this case).  This function would reload the module if it
!   was already imported.  If \var{name} points to a dotted name of the
!   form \code{package.module}, any package structures not already
!   created will still not be created.
  \end{cfuncdesc}
  
***************
*** 286,295 ****
  \end{cfuncdesc}
  
- \begin{cfuncdesc}{void}{PyMarshal_WriteShortToFile}{short value, FILE *file}
-   Marshal a \ctype{short} integer, \var{value}, to \var{file}.  This
-   will only write the least-significant 16 bits of \var{value};
-   regardless of the size of the native \ctype{short} type.
- \end{cfuncdesc}
- 
  \begin{cfuncdesc}{void}{PyMarshal_WriteObjectToFile}{PyObject *value,
                                                       FILE *file}
--- 290,293 ----
***************
*** 490,506 ****
    Convert a Python integer to a tiny int, stored in a C \ctype{char}.
  
    \item[\samp{h} (integer) {[short int]}]
    Convert a Python integer to a C \ctype{short int}.
  
    \item[\samp{i} (integer) {[int]}]
    Convert a Python integer to a plain C \ctype{int}.
  
    \item[\samp{l} (integer) {[long int]}]
    Convert a Python integer to a C \ctype{long int}.
  
!   \item[\samp{L} (integer) {[LONG_LONG]}]
    Convert a Python integer to a C \ctype{long long}.  This format is
    only available on platforms that support \ctype{long long} (or
    \ctype{_int64} on Windows).
  
    \item[\samp{c} (string of length 1) {[char]}]
--- 488,526 ----
    Convert a Python integer to a tiny int, stored in a C \ctype{char}.
  
+   \item[\samp{B} (integer) {[unsigned char]}]
+   Convert a Python integer to a tiny int without overflow checking,
+   stored in a C \ctype{unsigned char}. \versionadded{2.3}
+ 
    \item[\samp{h} (integer) {[short int]}]
    Convert a Python integer to a C \ctype{short int}.
  
+   \item[\samp{H} (integer) {[unsigned short int]}]
+   Convert a Python integer to a C \ctype{unsigned short int}, without
+   overflow checking.  \versionadded{2.3}
+ 
    \item[\samp{i} (integer) {[int]}]
    Convert a Python integer to a plain C \ctype{int}.
  
+   \item[\samp{I} (integer) {[unsigned int]}]
+   Convert a Python integer to a C \ctype{unsigned int}, without
+   overflow checking.  \versionadded{2.3}
+ 
    \item[\samp{l} (integer) {[long int]}]
    Convert a Python integer to a C \ctype{long int}.
  
!   \item[\samp{k} (integer) {[unsigned long]}]
!   Convert a Python integer to a C \ctype{unsigned long} without
!   overflow checking.  \versionadded{2.3}
! 
!   \item[\samp{L} (integer) {[PY_LONG_LONG]}]
    Convert a Python integer to a C \ctype{long long}.  This format is
    only available on platforms that support \ctype{long long} (or
    \ctype{_int64} on Windows).
+ 
+   \item[\samp{K} (integer) {[unsigned PY_LONG_LONG]}]
+   Convert a Python integer to a C \ctype{unsigned long long}
+   without overflow checking.  This format is only available on
+   platforms that support \ctype{unsigned long long} (or
+   \ctype{unsigned _int64} on Windows).  \versionadded{2.3}
  
    \item[\samp{c} (string of length 1) {[char]}]

Index: refcounts.dat
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v
retrieving revision 1.43
retrieving revision 1.43.2.1
diff -C2 -d -r1.43 -r1.43.2.1
*** refcounts.dat	2 Jul 2002 16:16:18 -0000	1.43
--- refcounts.dat	28 Apr 2003 17:38:11 -0000	1.43.2.1
***************
*** 812,815 ****
--- 812,818 ----
  PyObject_GetItem:PyObject*:key:0:
  
+ PyObject_GetIter:PyObject*::+1:
+ PyObject_GetIter:PyObject*:o:0:
+ 
  PyObject_HasAttr:int:::
  PyObject_HasAttr:PyObject*:o:0:

Index: newtypes.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/newtypes.tex,v
retrieving revision 1.13
retrieving revision 1.13.2.1
diff -C2 -d -r1.13 -r1.13.2.1
*** newtypes.tex	31 May 2002 21:00:18 -0000	1.13
--- newtypes.tex	28 Apr 2003 17:38:11 -0000	1.13.2.1
***************
*** 84,87 ****
--- 84,90 ----
    Create a new module object based on a name and table of functions,
    returning the new module object.
+ 
+   \versionchanged[Older versions of Python did not support \NULL{} as
+                   the value for the \var{methods} argument]{2.3}
  \end{cfuncdesc}
  
***************
*** 92,95 ****
--- 95,101 ----
    returning the new module object.  If \var{doc} is non-\NULL, it will
    be used to define the docstring for the module.
+ 
+   \versionchanged[Older versions of Python did not support \NULL{} as
+                   the value for the \var{methods} argument]{2.3}
  \end{cfuncdesc}
  
***************
*** 110,113 ****
--- 116,122 ----
    the \cfunction{Py_InitModule3()} instead; only use this if you are
    sure you need it.}
+ 
+   \versionchanged[Older versions of Python did not support \NULL{} as
+                   the value for the \var{methods} argument]{2.3}
  \end{cfuncdesc}
  
***************
*** 222,226 ****
  convention or a binding convention.  Of the calling convention flags,
  only \constant{METH_VARARGS} and \constant{METH_KEYWORDS} can be
! combined.  Any of the calling convention flags can be combined with a
  binding flag.
  
--- 231,237 ----
  convention or a binding convention.  Of the calling convention flags,
  only \constant{METH_VARARGS} and \constant{METH_KEYWORDS} can be
! combined (but note that \constant{METH_KEYWORDS} alone is equivalent
! to \code{\constant{METH_VARARGS} | \constant{METH_KEYWORDS}}).
! Any of the calling convention flags can be combined with a
  binding flag.
  
***************
*** 234,238 ****
    (often called \var{args}) is a tuple object representing all
    arguments. This parameter is typically processed using
!   \cfunction{PyArg_ParseTuple()}.
  \end{datadesc}
  
--- 245,249 ----
    (often called \var{args}) is a tuple object representing all
    arguments. This parameter is typically processed using
!   \cfunction{PyArg_ParseTuple()} or \cfunction{PyArg_UnpackTuple}.
  \end{datadesc}
  
***************
*** 249,256 ****
    Methods without parameters don't need to check whether arguments are
    given if they are listed with the \constant{METH_NOARGS} flag.  They
!   need to be of type \ctype{PyNoArgsFunction}: they expect a single
!   single \ctype{PyObject*} as a parameter.  When used with object
!   methods, this parameter is typically named \code{self} and will hold
!   a reference to the object instance.
  \end{datadesc}
  
--- 260,267 ----
    Methods without parameters don't need to check whether arguments are
    given if they are listed with the \constant{METH_NOARGS} flag.  They
!   need to be of type \ctype{PyCFunction}.  When used with object
!   methods, the first parameter is typically named \code{self} and will
!   hold a reference to the object instance.  In all cases the second
!   parameter will be \NULL.
  \end{datadesc}
  
***************
*** 336,344 ****
  \verbatiminput{typestruct.h}
  
! The type object structure extends the \ctype{PyVarObject} structure,
! though it does not actually need the the \member{ob_size} field.  The
! inclusion of this field is a historical accident that must be
! maintained to ensure binary compatibility between new versions of
! Python and older compiled extensions.
  
  \begin{cmemberdesc}{PyObject}{PyObject*}{_ob_next}
--- 347,356 ----
  \verbatiminput{typestruct.h}
  
! The type object structure extends the \ctype{PyVarObject} structure.
! The \member{ob_size} field is used for dynamic types (created
! by  \function{type_new()}, usually called from a class statement).
! Note that \cdata{PyType_Type} (the metatype) initializes
! \member{tp_itemsize}, which means that its instances (i.e. type
! objects) \emph{must} have the \member{ob_size} field.
  
  \begin{cmemberdesc}{PyObject}{PyObject*}{_ob_next}
***************
*** 413,427 ****
    should have the \member{tp_name} initializer \code{"P.Q.M.T"}.
  
!   For dynamically allocated type objects, this may be just the type
!   name, if the module name is explicitly stored in the type dict as
!   the value for key \code{'__module__'}.
  
!   If the tp_name field contains a dot, everything before the last dot
!   is made accessible as the \member{__module__} attribute, and
!   everything after the last dot is made accessible as the
!   \member{__name__} attribute.  If no dot is present, the entire
!   \member{tp_name} field is made accessible as the \member{__name__}
!   attribute, and the \member{__module__} attribute is undefined
!   (unless explicitly set in the dictionary, as explained above).
  
    This field is not inherited by subtypes.
--- 425,442 ----
    should have the \member{tp_name} initializer \code{"P.Q.M.T"}.
  
!   For dynamically allocated type objects, this should just be the type
!   name, and the module name explicitly stored in the type dict as the
!   value for key \code{'__module__'}.
  
!   For statically allocated type objects, the tp_name field should
!   contain a dot.  Everything before the last dot is made accessible as
!   the \member{__module__} attribute, and everything after the last dot
!   is made accessible as the \member{__name__} attribute.
! 
!   If no dot is present, the entire \member{tp_name} field is made
!   accessible as the \member{__name__} attribute, and the
!   \member{__module__} attribute is undefined (unless explicitly set in
!   the dictionary, as explained above).  This means your type will be
!   impossible to pickle.
  
    This field is not inherited by subtypes.
***************
*** 430,434 ****
  \begin{cmemberdesc}{PyTypeObject}{int}{tp_basicsize}
  \cmemberline{PyTypeObject}{int}{tp_itemsize}
!   These fields allow calculating the size in byte of instances of
    the type.
  
--- 445,449 ----
  \begin{cmemberdesc}{PyTypeObject}{int}{tp_basicsize}
  \cmemberline{PyTypeObject}{int}{tp_itemsize}
!   These fields allow calculating the size in bytes of instances of
    the type.
  
***************
*** 447,453 ****
    negative number, and N is \code{abs(\member{ob_size})} there.  Also,
    the presence of an \member{ob_size} field in the instance layout
!   doesn't mean that the type is variable-length (for example, the list
!   type has fixed-length instances, yet those instances have a
!   meaningful \member{ob_size} field).
  
    The basic size includes the fields in the instance declared by the
--- 462,468 ----
    negative number, and N is \code{abs(\member{ob_size})} there.  Also,
    the presence of an \member{ob_size} field in the instance layout
!   doesn't mean that the instance structure is variable-length (for
!   example, the structure for the list type has fixed-length instances,
!   yet those instances have a meaningful \member{ob_size} field).
  
    The basic size includes the fields in the instance declared by the
***************
*** 515,519 ****
  
    The print function is called with the same signature as
!   \cfunction{PyObject_Print()}: \code{tp_print(PyObject *self, FILE
    *file, int flags)}.  The \var{self} argument is the instance to be
    printed.  The \var{file} argument is the stdio file to which it is
--- 530,534 ----
  
    The print function is called with the same signature as
!   \cfunction{PyObject_Print()}: \code{int tp_print(PyObject *self, FILE
    *file, int flags)}.  The \var{self} argument is the instance to be
    printed.  The \var{file} argument is the stdio file to which it is
***************
*** 524,527 ****
--- 539,544 ----
    when the \constant{Py_PRINT_RAW} flag bit is clear, the instance
    should be printed the same was as \member{tp_repr} would format it.
+   It should return \code{-1} and set an exception condition when an
+   error occurred during the comparison.
  
    It is possible that the \member{tp_print} field will be deprecated.
***************
*** 869,874 ****
    An optional pointer to a traversal function for the garbage
    collector.  This is only used if the \constant{Py_TPFLAGS_HAVE_GC}
!   flag bit is set.  More information in section XXX about garbage
!   collection.
  
    This field is inherited by subtypes together with \member{tp_clear}
--- 886,891 ----
    An optional pointer to a traversal function for the garbage
    collector.  This is only used if the \constant{Py_TPFLAGS_HAVE_GC}
!   flag bit is set.  More information in section
!   \ref{supporting-cycle-detection} about garbage collection.
  
    This field is inherited by subtypes together with \member{tp_clear}
***************
*** 882,886 ****
    An optional pointer to a clear function for the garbage collector.
    This is only used if the \constant{Py_TPFLAGS_HAVE_GC} flag bit is
!   set.  More information in section XXX about garbage collection.
  
    This field is inherited by subtypes together with \member{tp_clear}
--- 899,904 ----
    An optional pointer to a clear function for the garbage collector.
    This is only used if the \constant{Py_TPFLAGS_HAVE_GC} flag bit is
!   set.  More information in section
!   \ref{supporting-cycle-detection} about garbage collection.
  
    This field is inherited by subtypes together with \member{tp_clear}
***************
*** 1489,1492 ****
--- 1507,1512 ----
  \begin{ctypedesc}[getcharbufferproc]{int (*getcharbufferproc)
                              (PyObject *self, int segment, const char **ptrptr)}
+   Return the size of the memory buffer in \var{ptrptr} for segment
+   \var{segment}.  \code{*\var{ptrptr}} is set to the memory buffer.
  \end{ctypedesc}
  

Index: init.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/init.tex,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -d -r1.3 -r1.3.2.1
*** init.tex	9 Apr 2002 21:09:42 -0000	1.3
--- init.tex	28 Apr 2003 17:38:11 -0000	1.3.2.1
***************
*** 59,65 ****
    leak, please report it).  Memory tied up in circular references
    between objects is not freed.  Some memory allocated by extension
!   modules may not be freed.  Some extension may not work properly if
    their initialization routine is called more than once; this can
!   happen if an applcation calls \cfunction{Py_Initialize()} and
    \cfunction{Py_Finalize()} more than once.
  \end{cfuncdesc}
--- 59,65 ----
    leak, please report it).  Memory tied up in circular references
    between objects is not freed.  Some memory allocated by extension
!   modules may not be freed.  Some extensions may not work properly if
    their initialization routine is called more than once; this can
!   happen if an application calls \cfunction{Py_Initialize()} and
    \cfunction{Py_Finalize()} more than once.
  \end{cfuncdesc}
***************
*** 234,238 ****
    directory names separated by a platform dependent delimiter
    character.  The delimiter character is \character{:} on \UNIX,
!   \character{;} on DOS/Windows, and \character{\e n} (the \ASCII{}
    newline character) on Macintosh.  The returned string points into
    static storage; the caller should not modify its value.  The value
--- 234,238 ----
    directory names separated by a platform dependent delimiter
    character.  The delimiter character is \character{:} on \UNIX,
!   \character{;} on Windows, and \character{\e n} (the \ASCII{}
    newline character) on Macintosh.  The returned string points into
    static storage; the caller should not modify its value.  The value
***************
*** 257,261 ****
    version separated by a period.  The returned string points into
    static storage; the caller should not modify its value.  The value
!   is available to Python code as the list \code{sys.version}.
    \withsubitem{(in module sys)}{\ttindex{version}}
  \end{cfuncdesc}
--- 257,261 ----
    version separated by a period.  The returned string points into
    static storage; the caller should not modify its value.  The value
!   is available to Python code as \code{sys.version}.
    \withsubitem{(in module sys)}{\ttindex{version}}
  \end{cfuncdesc}
***************
*** 280,285 ****
  
    The returned string points into static storage; the caller should
!   not modify its value.  The value is available to Python code as the
!   list \code{sys.copyright}.
    \withsubitem{(in module sys)}{\ttindex{copyright}}
  \end{cfuncdesc}
--- 280,285 ----
  
    The returned string points into static storage; the caller should
!   not modify its value.  The value is available to Python code as
!   \code{sys.copyright}.
    \withsubitem{(in module sys)}{\ttindex{copyright}}
  \end{cfuncdesc}
***************
*** 467,470 ****
--- 467,492 ----
  thread after Python is initialized).
  
+ Assuming you have access to an interpreter object, the typical idiom
+ for calling into Python from a C thread is
+ 
+ \begin{verbatim}
+     PyThreadState *tstate;
+     PyObject *result;
+ 
+     /* interp is your reference to an interpreter object. */
+     tstate = PyThreadState_New(interp);
+     PyEval_AcquireThread(tstate);
+ 
+     /* Perform Python actions here.  */
+     result = CallSomeFunction();
+     /* evaluate result */
+ 
+     /* Release the thread. No Python API allowed beyond this point. */
+     PyEval_ReleaseThread(tstate);
+ 
+     /* You can either delete the thread state, or save it
+        until you need it the next time. */
+     PyThreadState_Delete(tstate);
+ \end{verbatim}
  
  \begin{ctypedesc}{PyInterpreterState}
***************
*** 656,662 ****
    Return a dictionary in which extensions can store thread-specific
    state information.  Each extension should use a unique key to use to
!   store state in the dictionary.  If this function returns \NULL, an
!   exception has been raised and the caller should allow it to
!   propogate.
  \end{cfuncdesc}
  
--- 678,687 ----
    Return a dictionary in which extensions can store thread-specific
    state information.  Each extension should use a unique key to use to
!   store state in the dictionary.  It is okay to call this function
!   when no current thread state is available.
!   If this function returns \NULL, no exception has been raised and the
!   caller should assume no current thread state is available.
!   \versionchanged[Previously this could only be called when a current
!   thread is active, and \NULL meant that an exception was raised]{2.3}
  \end{cfuncdesc}
  
***************
*** 716,720 ****
    being executed.  The effect of this is that as exception propogation
    causes the Python stack to unwind, the callback is called upon
!   return to each frame as the exception propogates.  Only trace
    functions receives these events; they are not needed by the
    profiler.
--- 741,745 ----
    being executed.  The effect of this is that as exception propogation
    causes the Python stack to unwind, the callback is called upon
!   return to each frame as the exception propagates.  Only trace
    functions receives these events; they are not needed by the
    profiler.

Index: exceptions.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/exceptions.tex,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -d -r1.7 -r1.7.2.1
*** exceptions.tex	2 Jul 2002 16:17:58 -0000	1.7
--- exceptions.tex	28 Apr 2003 17:38:12 -0000	1.7.2.1
***************
*** 20,24 ****
  error.  If returning due to an error, it is important to indicate to
  the caller that an error has been set.  If the error is not handled or
! carefully propogated, additional calls into the Python/C API may not
  behave as intended and may fail in mysterious ways.
  
--- 20,24 ----
  error.  If returning due to an error, it is important to indicate to
  the caller that an error has been set.  If the error is not handled or
! carefully propagated, additional calls into the Python/C API may not
  behave as intended and may fail in mysterious ways.
  
***************
*** 103,108 ****
    \NULL, the error indicator is cleared.  Do not pass a \NULL{} type
    and non-\NULL{} value or traceback.  The exception type should be a
!   string or class; if it is a class, the value should be an instance
!   of that class.  Do not pass an invalid exception type or value.
    (Violating these rules will cause subtle problems later.)  This call
    takes away a reference to each object: you must own a reference to
--- 103,107 ----
    \NULL, the error indicator is cleared.  Do not pass a \NULL{} type
    and non-\NULL{} value or traceback.  The exception type should be a
!   string or class.  Do not pass an invalid exception type or value.
    (Violating these rules will cause subtle problems later.)  This call
    takes away a reference to each object: you must own a reference to
***************
*** 111,115 ****
    function.  I warned you.)  \note{This function is normally only used
    by code that needs to save and restore the error indicator
!   temporarily.}
  \end{cfuncdesc}
  
--- 110,115 ----
    function.  I warned you.)  \note{This function is normally only used
    by code that needs to save and restore the error indicator
!   temporarily; use \cfunction{PyErr_Fetch()} to save the current
!   exception state.}
  \end{cfuncdesc}
  
***************
*** 125,129 ****
    This function is similar to \cfunction{PyErr_SetString()} but lets
    you specify an arbitrary Python object for the ``value'' of the
!   exception.  You need not increment its reference count.
  \end{cfuncdesc}
  
--- 125,129 ----
    This function is similar to \cfunction{PyErr_SetString()} but lets
    you specify an arbitrary Python object for the ``value'' of the
!   exception.
  \end{cfuncdesc}
  
***************
*** 209,212 ****
--- 209,220 ----
  \end{cfuncdesc}
  
+ \begin{cfuncdesc}{PyObject*}{PyErr_SetExcFromWindowsErr}{PyObject *type,
+ 	                                                 int ierr}
+   Similar to \cfunction{PyErr_SetFromWindowsErr()}, with an additional
+   parameter specifying the exception type to be raised.
+   Availability: Windows.
+   \versionadded{2.3}
+ \end{cfuncdesc}
+ 
  \begin{cfuncdesc}{PyObject*}{PyErr_SetFromWindowsErrWithFilename}{int ierr,
                                                                  char *filename}
***************
*** 218,221 ****
--- 226,237 ----
  \end{cfuncdesc}
  
+ \begin{cfuncdesc}{PyObject*}{PyErr_SetExcFromWindowsErrWithFilename}
+ 	{PyObject *type, int ierr, char *filename}
+   Similar to \cfunction{PyErr_SetFromWindowsErrWithFilename()}, with
+   an additional parameter specifying the exception type to be raised.
+   Availability: Windows.
+   \versionadded{2.3}
+ \end{cfuncdesc}
+ 
  \begin{cfuncdesc}{void}{PyErr_BadInternalCall}{}
    This is a shorthand for \samp{PyErr_SetString(PyExc_TypeError,
***************
*** 250,257 ****
    These have the type \ctype{PyObject*}; they are all class objects.
    Their names are \cdata{PyExc_Warning}, \cdata{PyExc_UserWarning},
!   \cdata{PyExc_DeprecationWarning}, \cdata{PyExc_SyntaxWarning}, and
!   \cdata{PyExc_RuntimeWarning}.  \cdata{PyExc_Warning} is a subclass
!   of \cdata{PyExc_Exception}; the other warning categories are
!   subclasses of \cdata{PyExc_Warning}.
  
    For information about warning control, see the documentation for the
--- 266,273 ----
    These have the type \ctype{PyObject*}; they are all class objects.
    Their names are \cdata{PyExc_Warning}, \cdata{PyExc_UserWarning},
!   \cdata{PyExc_DeprecationWarning}, \cdata{PyExc_SyntaxWarning},
!   \cdata{PyExc_RuntimeWarning}, and \cdata{PyExc_FutureWarning}.
!   \cdata{PyExc_Warning} is a subclass of \cdata{PyExc_Exception}; the
!   other warning categories are subclasses of \cdata{PyExc_Warning}.
  
    For information about warning control, see the documentation for the

Index: concrete.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C2 -d -r1.17 -r1.17.2.1
*** concrete.tex	20 Jun 2002 22:07:04 -0000	1.17
--- concrete.tex	28 Apr 2003 17:38:12 -0000	1.17.2.1
***************
*** 130,133 ****
--- 130,152 ----
  \end{cfuncdesc}
  
+ \begin{cfuncdesc}{PyObject*}{PyInt_FromString}{char *str, char **pend,
+                                                int base}
+   Return a new \ctype{PyIntObject} or \ctype{PyLongObject} based on the
+   string value in \var{str}, which is interpreted according to the radix in
+   \var{base}.  If \var{pend} is non-\NULL, \code{*\var{pend}} will point to
+   the first character in \var{str} which follows the representation of the
+   number.  If \var{base} is \code{0}, the radix will be determined based on
+   the leading characters of \var{str}: if \var{str} starts with \code{'0x'}
+   or \code{'0X'}, radix 16 will be used; if \var{str} starts with
+   \code{'0'}, radix 8 will be used; otherwise radix 10 will be used.  If
+   \var{base} is not \code{0}, it must be between \code{2} and \code{36},
+   inclusive.  Leading spaces are ignored.  If there are no digits,
+   \exception{ValueError} will be raised.  If the string represents a number
+   too large to be contained within the machine's \ctype{long int} type and
+   overflow warnings are being suppressed, a \ctype{PyLongObject} will be
+   returned.  If overflow warnings are not being suppressed, \NULL{} will be
+   returned in this case.
+ \end{cfuncdesc}
+ 
  \begin{cfuncdesc}{PyObject*}{PyInt_FromLong}{long ival}
    Creates a new integer object with a value of \var{ival}.
***************
*** 150,153 ****
--- 169,186 ----
  \end{cfuncdesc}
  
+ \begin{cfuncdesc}{unsigned long}{PyInt_AsUnsignedLongMask}{PyObject *io}
+   Will first attempt to cast the object to a \ctype{PyIntObject} or
+   \ctype{PyLongObject}, if it is not already one, and then return its
+   value as unsigned long.  This function does not check for overflow.
+   \versionadded{2.3}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{unsigned long}{PyInt_AsUnsignedLongLongMask}{PyObject *io}
+   Will first attempt to cast the object to a \ctype{PyIntObject} or
+   \ctype{PyLongObject}, if it is not already one, and then return its
+   value as unsigned long long, without checking for overflow.
+   \versionadded{2.3}
+ \end{cfuncdesc}
+ 
  \begin{cfuncdesc}{long}{PyInt_GetMax}{}
    Returns the system's idea of the largest integer it can handle
***************
*** 215,219 ****
    point to the first character in \var{str} which follows the
    representation of the number.  If \var{base} is \code{0}, the radix
!   will be determined base on the leading characters of \var{str}: if
    \var{str} starts with \code{'0x'} or \code{'0X'}, radix 16 will be
    used; if \var{str} starts with \code{'0'}, radix 8 will be used;
--- 248,252 ----
    point to the first character in \var{str} which follows the
    representation of the number.  If \var{base} is \code{0}, the radix
!   will be determined based on the leading characters of \var{str}: if
    \var{str} starts with \code{'0x'} or \code{'0X'}, radix 16 will be
    used; if \var{str} starts with \code{'0'}, radix 8 will be used;
***************
*** 275,278 ****
--- 308,323 ----
  \end{cfuncdesc}
  
+ \begin{cfuncdesc}{unsigned long}{PyLong_AsUnsignedLongMask}{PyObject *io}
+   Return a C \ctype{unsigned long} from a Python long integer, without
+   checking for overflow.
+   \versionadded{2.3}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{unsigned long}{PyLong_AsUnsignedLongLongMask}{PyObject *io}
+   Return a C \ctype{unsigned long long} from a Python long integer, without
+   checking for overflow.
+   \versionadded{2.3}
+ \end{cfuncdesc}
+ 
  \begin{cfuncdesc}{double}{PyLong_AsDouble}{PyObject *pylong}
    Returns a C \ctype{double} representation of the contents of
***************
*** 318,321 ****
--- 363,372 ----
  \end{cfuncdesc}
  
+ \begin{cfuncdesc}{PyObject*}{PyFloat_FromString}{PyObject *str, char **pend}
+   Creates a \ctype{PyFloatObject} object based on the string value in
+   \var{str}, or \NULL{} on failure.  The \var{pend} argument is ignored.  It
+   remains only for backward compatibility.
+ \end{cfuncdesc}
+ 
  \begin{cfuncdesc}{PyObject*}{PyFloat_FromDouble}{double v}
    Creates a \ctype{PyFloatObject} object from \var{v}, or \NULL{} on
***************
*** 534,548 ****
  
  \begin{cfuncdesc}{char*}{PyString_AsString}{PyObject *string}
!   Returns a null-terminated representation of the contents of
    \var{string}.  The pointer refers to the internal buffer of
    \var{string}, not a copy.  The data must not be modified in any way,
    unless the string was just created using
    \code{PyString_FromStringAndSize(NULL, \var{size})}.
!   It must not be deallocated.
  \end{cfuncdesc}
  
  \begin{cfuncdesc}{char*}{PyString_AS_STRING}{PyObject *string}
    Macro form of \cfunction{PyString_AsString()} but without error
!   checking.
  \end{cfuncdesc}
  
--- 585,604 ----
  
  \begin{cfuncdesc}{char*}{PyString_AsString}{PyObject *string}
!   Returns a NUL-terminated representation of the contents of
    \var{string}.  The pointer refers to the internal buffer of
    \var{string}, not a copy.  The data must not be modified in any way,
    unless the string was just created using
    \code{PyString_FromStringAndSize(NULL, \var{size})}.
!   It must not be deallocated.  If \var{string} is a Unicode object,
!   this function computes the default encoding of \var{string} and
!   operates on that.  If \var{string} is not a string object at all,
!   \cfunction{PyString_AsString()} returns \NULL{} and raises
!   \exception{TypeError}.
  \end{cfuncdesc}
  
  \begin{cfuncdesc}{char*}{PyString_AS_STRING}{PyObject *string}
    Macro form of \cfunction{PyString_AsString()} but without error
!   checking.  Only string objects are supported; no Unicode objects
!   should be passed.
  \end{cfuncdesc}
  
***************
*** 550,554 ****
                                                   char **buffer,
                                                   int *length}
!   Returns a null-terminated representation of the contents of the
    object \var{obj} through the output variables \var{buffer} and
    \var{length}.
--- 606,610 ----
                                                   char **buffer,
                                                   int *length}
!   Returns a NUL-terminated representation of the contents of the
    object \var{obj} through the output variables \var{buffer} and
    \var{length}.
***************
*** 556,567 ****
    The function accepts both string and Unicode objects as input. For
    Unicode objects it returns the default encoded version of the
!   object.  If \var{length} is set to \NULL, the resulting buffer may
!   not contain null characters; if it does, the function returns -1 and
!   a \exception{TypeError} is raised.
  
    The buffer refers to an internal string buffer of \var{obj}, not a
    copy. The data must not be modified in any way, unless the string
    was just created using \code{PyString_FromStringAndSize(NULL,
!   \var{size})}.  It must not be deallocated.
  \end{cfuncdesc}
  
--- 612,627 ----
    The function accepts both string and Unicode objects as input. For
    Unicode objects it returns the default encoded version of the
!   object.  If \var{length} is \NULL, the resulting buffer may not
!   contain NUL characters; if it does, the function returns \code{-1}
!   and a \exception{TypeError} is raised.
  
    The buffer refers to an internal string buffer of \var{obj}, not a
    copy. The data must not be modified in any way, unless the string
    was just created using \code{PyString_FromStringAndSize(NULL,
!   \var{size})}.  It must not be deallocated.  If \var{string} is a
!   Unicode object, this function computes the default encoding of
!   \var{string} and operates on that.  If \var{string} is not a string
!   object at all, \cfunction{PyString_AsString()} returns \NULL{} and
!   raises \exception{TypeError}.
  \end{cfuncdesc}
  
***************
*** 1286,1293 ****
  
  \begin{cfuncdesc}{PyObject*}{PyUnicode_Splitlines}{PyObject *s,
!                                                    int maxsplit}
    Split a Unicode string at line breaks, returning a list of Unicode
!   strings.  CRLF is considered to be one line break.  The Line break
!   characters are not included in the resulting strings.
  \end{cfuncdesc}
  
--- 1346,1354 ----
  
  \begin{cfuncdesc}{PyObject*}{PyUnicode_Splitlines}{PyObject *s,
!                                                    int keepend}
    Split a Unicode string at line breaks, returning a list of Unicode
!   strings.  CRLF is considered to be one line break.  If \var{keepend}
!   is 0, the Line break characters are not included in the resulting
!   strings.
  \end{cfuncdesc}
  
***************
*** 2376,2380 ****
  \begin{cfuncdesc}{PyObject*}{PyWeakref_GetObject}{PyObject *ref}
    Returns the referenced object from a weak reference, \var{ref}.  If
!   the referent is no longer live, returns \NULL.
    \versionadded{2.2}
  \end{cfuncdesc}
--- 2437,2441 ----
  \begin{cfuncdesc}{PyObject*}{PyWeakref_GetObject}{PyObject *ref}
    Returns the referenced object from a weak reference, \var{ref}.  If
!   the referent is no longer live, returns \code{None}.
    \versionadded{2.2}
  \end{cfuncdesc}

Index: abstract.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v
retrieving revision 1.17
retrieving revision 1.17.2.1
diff -C2 -d -r1.17 -r1.17.2.1
*** abstract.tex	14 Jun 2002 14:35:56 -0000	1.17
--- abstract.tex	28 Apr 2003 17:38:12 -0000	1.17.2.1
***************
*** 167,172 ****
    the Unicode string representation on success, \NULL{} on failure.
    This is the equivalent of the Python expression
!   \samp{unistr(\var{o})}.  Called by the
!   \function{unistr()}\bifuncindex{unistr} built-in function.
  \end{cfuncdesc}
  
--- 167,172 ----
    the Unicode string representation on success, \NULL{} on failure.
    This is the equivalent of the Python expression
!   \samp{unicode(\var{o})}.  Called by the
!   \function{unicode()}\bifuncindex{unicode} built-in function.
  \end{cfuncdesc}
  
***************
*** 176,185 ****
    \code{-1} and sets an exception.  If \var{cls} is a type object
    rather than a class object, \cfunction{PyObject_IsInstance()}
!   returns \code{1} if \var{inst} is of type \var{cls}.  If \var{inst}
!   is not a class instance and \var{cls} is neither a type object or
!   class object, \var{inst} must have a \member{__class__} attribute
    --- the class relationship of the value of that attribute with
    \var{cls} will be used to determine the result of this function.
    \versionadded{2.1}
  \end{cfuncdesc}
  
--- 176,189 ----
    \code{-1} and sets an exception.  If \var{cls} is a type object
    rather than a class object, \cfunction{PyObject_IsInstance()}
!   returns \code{1} if \var{inst} is of type \var{cls}.  If \var{cls}
!   is a tuple, the check will be done against every entry in \var{cls}.
!   The result will be \code{1} when at least one of the checks returns
!   \code{1}, otherwise it will be \code{0}. If \var{inst} is not a class
!   instance and \var{cls} is neither a type object, nor a class object,
!   nor a tuple, \var{inst} must have a \member{__class__} attribute
    --- the class relationship of the value of that attribute with
    \var{cls} will be used to determine the result of this function.
    \versionadded{2.1}
+   \versionchanged[Support for a tuple as the second argument added]{2.2}
  \end{cfuncdesc}
  
***************
*** 202,209 ****
    Returns \code{1} if the class \var{derived} is identical to or
    derived from the class \var{cls}, otherwise returns \code{0}.  In
!   case of an error, returns \code{-1}.  If either \var{derived} or
!   \var{cls} is not an actual class object, this function uses the
!   generic algorithm described above.
    \versionadded{2.1}
  \end{cfuncdesc}
  
--- 206,218 ----
    Returns \code{1} if the class \var{derived} is identical to or
    derived from the class \var{cls}, otherwise returns \code{0}.  In
!   case of an error, returns \code{-1}. If \var{cls}
!   is a tuple, the check will be done against every entry in \var{cls}.
!   The result will be \code{1} when at least one of the checks returns
!   \code{1}, otherwise it will be \code{0}. If either \var{derived} or
!   \var{cls} is not an actual class object (or tuple), this function
!   uses the generic algorithm described above.
    \versionadded{2.1}
+   \versionchanged[Older versions of Python did not support a tuple
+                   as the second argument]{2.3}
  \end{cfuncdesc}
  
***************
*** 228,231 ****
--- 237,241 ----
    or \samp{\var{callable_object}(*\var{args}, **\var{kw})}.
    \bifuncindex{apply}
+   \versionadded{2.2}
  \end{cfuncdesc}
  
***************
*** 301,305 ****
    Returns \code{1} if the object \var{o} is considered to be true, and
    \code{0} otherwise.  This is equivalent to the Python expression
!   \samp{not not \var{o}}.  This function always succeeds.
  \end{cfuncdesc}
  
--- 311,322 ----
    Returns \code{1} if the object \var{o} is considered to be true, and
    \code{0} otherwise.  This is equivalent to the Python expression
!   \samp{not not \var{o}}.  On failure, return \code{-1}. 
! \end{cfuncdesc}
! 
! 
! \begin{cfuncdesc}{int}{PyObject_Not}{PyObject *o}
!   Returns \code{0} if the object \var{o} is considered to be true, and
!   \code{1} otherwise.  This is equivalent to the Python expression
!   \samp{not \var{o}}.  On failure, return \code{-1}. 
  \end{cfuncdesc}
  
***************
*** 309,314 ****
    the object type of object \var{o}. On failure, raises
    \exception{SystemError} and returns \NULL.  This is equivalent to
!   the Python expression \code{type(\var{o})}.
!   \bifuncindex{type}
  \end{cfuncdesc}
  
--- 326,335 ----
    the object type of object \var{o}. On failure, raises
    \exception{SystemError} and returns \NULL.  This is equivalent to
!   the Python expression \code{type(\var{o})}.\bifuncindex{type}
!   This function increments the reference count of the return value.
!   There's really no reason to use this function instead of the
!   common expression \code{\var{o}->ob_type}, which returns a pointer
!   of type \ctype{PyTypeObject*}, except when the incremented reference
!   count is needed.
  \end{cfuncdesc}
  
***************
*** 651,656 ****
  \begin{cfuncdesc}{PyObject*}{PyNumber_Int}{PyObject *o}
    Returns the \var{o} converted to an integer object on success, or
!   \NULL{} on failure.  This is the equivalent of the Python expression
!   \samp{int(\var{o})}.\bifuncindex{int}
  \end{cfuncdesc}
  
--- 672,678 ----
  \begin{cfuncdesc}{PyObject*}{PyNumber_Int}{PyObject *o}
    Returns the \var{o} converted to an integer object on success, or
!   \NULL{} on failure.  If the argument is outside the integer range
!   a long object will be returned instead. This is the equivalent
!   of the Python expression \samp{int(\var{o})}.\bifuncindex{int}
  \end{cfuncdesc}
  
***************
*** 988,992 ****
  
  \begin{cfuncdesc}{int}{PyObject_AsWriteBuffer}{PyObject *obj,
!                                                const char **buffer,
                                                 int *buffer_len}
    Returns a pointer to a writeable memory location.  The \var{obj}
--- 1010,1014 ----
  
  \begin{cfuncdesc}{int}{PyObject_AsWriteBuffer}{PyObject *obj,
!                                                char **buffer,
                                                 int *buffer_len}
    Returns a pointer to a writeable memory location.  The \var{obj}