[Python-checkins] python/dist/src/Doc/api concrete.tex,1.45,1.46

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Sun Jul 11 21:26:21 CEST 2004


Update of /cvsroot/python/python/dist/src/Doc/api
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12108/Doc/api

Modified Files:
	concrete.tex 
Log Message:
SF patch 986010: add missing doc for datetime C API, from
Anthony Tuininga.

This is a derived patch, taking the opportunity to add some organization
to the now-large pile of datetime-related macros, and to factor out
tedious repeated text.

Also improved some clumsy wording in NEWS.


Index: concrete.tex
===================================================================
RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -d -r1.45 -r1.46
*** concrete.tex	20 Jun 2004 22:41:23 -0000	1.45
--- concrete.tex	11 Jul 2004 19:26:19 -0000	1.46
***************
*** 2657,2663 ****
  must be invoked.  The macro arranges to put a pointer to a C structure
  in a static variable \code{PyDateTimeAPI}, which is used by the following
! macros:
  
! \begin{cfuncdesc}{int}{PyDate_Check}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DateType} or
    a subtype of \cdata{PyDateTime_DateType}.  \var{ob} must not be
--- 2657,2665 ----
  must be invoked.  The macro arranges to put a pointer to a C structure
  in a static variable \code{PyDateTimeAPI}, which is used by the following
! macros.
  
! Type-check macros:
! 
! \begin{cfuncdesc}{int}{PyDate_Check}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DateType} or
    a subtype of \cdata{PyDateTime_DateType}.  \var{ob} must not be
***************
*** 2666,2670 ****
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDate_CheckExact}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DateType}.
    \var{ob} must not be \NULL{}.
--- 2668,2672 ----
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDate_CheckExact}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DateType}.
    \var{ob} must not be \NULL{}.
***************
*** 2672,2676 ****
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDateTime_Check}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DateTimeType} or
    a subtype of \cdata{PyDateTime_DateTimeType}.  \var{ob} must not be
--- 2674,2678 ----
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDateTime_Check}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DateTimeType} or
    a subtype of \cdata{PyDateTime_DateTimeType}.  \var{ob} must not be
***************
*** 2679,2683 ****
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDateTime_CheckExact}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DateTimeType}.
    \var{ob} must not be \NULL{}.
--- 2681,2685 ----
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDateTime_CheckExact}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DateTimeType}.
    \var{ob} must not be \NULL{}.
***************
*** 2685,2689 ****
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyTime_Check}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_TimeType} or
    a subtype of \cdata{PyDateTime_TimeType}.  \var{ob} must not be
--- 2687,2691 ----
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyTime_Check}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_TimeType} or
    a subtype of \cdata{PyDateTime_TimeType}.  \var{ob} must not be
***************
*** 2692,2696 ****
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyTime_CheckExact}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_TimeType}.
    \var{ob} must not be \NULL{}.
--- 2694,2698 ----
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyTime_CheckExact}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_TimeType}.
    \var{ob} must not be \NULL{}.
***************
*** 2698,2702 ****
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDelta_Check}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DeltaType} or
    a subtype of \cdata{PyDateTime_DeltaType}.  \var{ob} must not be
--- 2700,2704 ----
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDelta_Check}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DeltaType} or
    a subtype of \cdata{PyDateTime_DeltaType}.  \var{ob} must not be
***************
*** 2705,2709 ****
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDelta_CheckExact}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DeltaType}.
    \var{ob} must not be \NULL{}.
--- 2707,2711 ----
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyDelta_CheckExact}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_DeltaType}.
    \var{ob} must not be \NULL{}.
***************
*** 2711,2715 ****
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyTZInfo_Check}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_TZInfoType} or
    a subtype of \cdata{PyDateTime_TZInfoType}.  \var{ob} must not be
--- 2713,2717 ----
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyTZInfo_Check}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_TZInfoType} or
    a subtype of \cdata{PyDateTime_TZInfoType}.  \var{ob} must not be
***************
*** 2718,2722 ****
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyTZInfo_CheckExact}{ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_TZInfoType}.
    \var{ob} must not be \NULL{}.
--- 2720,2724 ----
  \end{cfuncdesc}
  
! \begin{cfuncdesc}{int}{PyTZInfo_CheckExact}{PyObject *ob}
    Return true if \var{ob} is of type \cdata{PyDateTime_TZInfoType}.
    \var{ob} must not be \NULL{}.
***************
*** 2724,2727 ****
--- 2726,2731 ----
  \end{cfuncdesc}
  
+ Macros to create objects:
+ 
  \begin{cfuncdesc}{PyObject*}{PyDate_FromDate}{int year, int month, int day}
    Return a \code{datetime.date} object with the specified year, month
***************
*** 2753,2761 ****
  \end{cfuncdesc}
  
  \begin{cfuncdesc}{PyObject*}{PyDateTime_FromTimestamp}{PyObject *args}
    Create and return a new \code{datetime.datetime} object given an argument
    tuple suitable for passing to \code{datetime.datetime.fromtimestamp()}.
-   This macro is included for the convenience of modules implementing the
-   DB API.
    \versionadded{2.4}
  \end{cfuncdesc}
--- 2757,2833 ----
  \end{cfuncdesc}
  
+ Macros to extract fields from date objects.  The argument must an
+ instance of \cdata{PyDateTime_Date}, including subclasses (such as
+ \cdata{PyDateTime_DateTime}).  The argument must not be \NULL{}, and
+ the type is not checked:
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_GET_YEAR}{PyDateTime_Date *o}
+   Return the year, as a positive int.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_GET_MONTH}{PyDateTime_Date *o}
+   Return the month, as an int from 1 through 12.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_GET_DAY}{PyDateTime_Date *o}
+   Return the day, as an int from 1 through 31.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ Macros to extract fields from datetime objects.  The argument must an
+ instance of \cdata{PyDateTime_DateTime}, including subclasses.
+ The argument must not be \NULL{}, and the type is not checked:
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_DATE_GET_HOUR}{PyDateTime_DateTime *o}
+   Return the hour, an an int from 0 though 23.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_DATE_GET_MINUTE}{PyDateTime_DateTime *o}
+   Return the minute, as an int from 0 through 59.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_DATE_GET_SECOND}{PyDateTime_DateTime *o}
+   Return the second, as an int from 0 through 59.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_DATE_GET_MICROSECOND}{PyDateTime_DateTime *o}
+   Return the microsecond, as an int from 0 through 999999.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ Macros to extract fields from time objects.  The argument must an
+ instance of \cdata{PyDateTime_Time}, including subclasses.
+ The argument must not be \NULL{}, and the type is not checked:
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_TIME_GET_HOUR}{PyDateTime_Time *o}
+   Return the hour, as an int from 0 though 23.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_TIME_GET_MINUTE}{PyDateTime_Time *o}
+   Return the minute, as an int from 0 through 59.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_TIME_GET_SECOND}{PyDateTime_Time *o}
+   Return the second, as an int from 0 through 59.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ \begin{cfuncdesc}{int}{PyDateTime_TIME_GET_MICROSECOND}{PyDateTime_Time *o}
+   Return the microsecond, as an int from 0 through 999999.
+   \versionadded{2.4}
+ \end{cfuncdesc}
+ 
+ Macros for the convenience of modules implementing the DB API:
+ 
  \begin{cfuncdesc}{PyObject*}{PyDateTime_FromTimestamp}{PyObject *args}
    Create and return a new \code{datetime.datetime} object given an argument
    tuple suitable for passing to \code{datetime.datetime.fromtimestamp()}.
    \versionadded{2.4}
  \end{cfuncdesc}
***************
*** 2764,2769 ****
    Create and return a new \code{datetime.date} object given an argument
    tuple suitable for passing to \code{datetime.date.fromtimestamp()}.
-   This macro is included for the convenience of modules implementing the
-   DB API.
    \versionadded{2.4}
  \end{cfuncdesc}
--- 2836,2839 ----



More information about the Python-checkins mailing list