Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (11 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Doc/c-api/datetime.rst

    r2 r391  
    99Before using any of these functions, the header file :file:`datetime.h` must be
    1010included in your source (note that this is not included by :file:`Python.h`),
    11 and the macro :cfunc:`PyDateTime_IMPORT` must be invoked.  The macro puts a
    12 pointer to a C structure into a static variable,  ``PyDateTimeAPI``, that is
    13 used by the following macros.
     11and the macro :c:macro:`PyDateTime_IMPORT` must be invoked, usually as part of
     12the module initialisation function.  The macro puts a pointer to a C structure
     13into a static variable, :c:data:`PyDateTimeAPI`, that is used by the following
     14macros.
    1415
    1516Type-check macros:
    1617
    1718
    18 .. cfunction:: int PyDate_Check(PyObject *ob)
    19 
    20    Return true if *ob* is of type :cdata:`PyDateTime_DateType` or a subtype of
    21    :cdata:`PyDateTime_DateType`.  *ob* must not be *NULL*.
    22 
    23    .. versionadded:: 2.4
    24 
    25 
    26 .. cfunction:: int PyDate_CheckExact(PyObject *ob)
    27 
    28    Return true if *ob* is of type :cdata:`PyDateTime_DateType`. *ob* must not be
    29    *NULL*.
    30 
    31    .. versionadded:: 2.4
    32 
    33 
    34 .. cfunction:: int PyDateTime_Check(PyObject *ob)
    35 
    36    Return true if *ob* is of type :cdata:`PyDateTime_DateTimeType` or a subtype of
    37    :cdata:`PyDateTime_DateTimeType`.  *ob* must not be *NULL*.
    38 
    39    .. versionadded:: 2.4
    40 
    41 
    42 .. cfunction:: int PyDateTime_CheckExact(PyObject *ob)
    43 
    44    Return true if *ob* is of type :cdata:`PyDateTime_DateTimeType`. *ob* must not
     19.. c:function:: int PyDate_Check(PyObject *ob)
     20
     21   Return true if *ob* is of type :c:data:`PyDateTime_DateType` or a subtype of
     22   :c:data:`PyDateTime_DateType`.  *ob* must not be *NULL*.
     23
     24   .. versionadded:: 2.4
     25
     26
     27.. c:function:: int PyDate_CheckExact(PyObject *ob)
     28
     29   Return true if *ob* is of type :c:data:`PyDateTime_DateType`. *ob* must not be
     30   *NULL*.
     31
     32   .. versionadded:: 2.4
     33
     34
     35.. c:function:: int PyDateTime_Check(PyObject *ob)
     36
     37   Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType` or a subtype of
     38   :c:data:`PyDateTime_DateTimeType`.  *ob* must not be *NULL*.
     39
     40   .. versionadded:: 2.4
     41
     42
     43.. c:function:: int PyDateTime_CheckExact(PyObject *ob)
     44
     45   Return true if *ob* is of type :c:data:`PyDateTime_DateTimeType`. *ob* must not
    4546   be *NULL*.
    4647
     
    4849
    4950
    50 .. cfunction:: int PyTime_Check(PyObject *ob)
    51 
    52    Return true if *ob* is of type :cdata:`PyDateTime_TimeType` or a subtype of
    53    :cdata:`PyDateTime_TimeType`.  *ob* must not be *NULL*.
    54 
    55    .. versionadded:: 2.4
    56 
    57 
    58 .. cfunction:: int PyTime_CheckExact(PyObject *ob)
    59 
    60    Return true if *ob* is of type :cdata:`PyDateTime_TimeType`. *ob* must not be
    61    *NULL*.
    62 
    63    .. versionadded:: 2.4
    64 
    65 
    66 .. cfunction:: int PyDelta_Check(PyObject *ob)
    67 
    68    Return true if *ob* is of type :cdata:`PyDateTime_DeltaType` or a subtype of
    69    :cdata:`PyDateTime_DeltaType`.  *ob* must not be *NULL*.
    70 
    71    .. versionadded:: 2.4
    72 
    73 
    74 .. cfunction:: int PyDelta_CheckExact(PyObject *ob)
    75 
    76    Return true if *ob* is of type :cdata:`PyDateTime_DeltaType`. *ob* must not be
    77    *NULL*.
    78 
    79    .. versionadded:: 2.4
    80 
    81 
    82 .. cfunction:: int PyTZInfo_Check(PyObject *ob)
    83 
    84    Return true if *ob* is of type :cdata:`PyDateTime_TZInfoType` or a subtype of
    85    :cdata:`PyDateTime_TZInfoType`.  *ob* must not be *NULL*.
    86 
    87    .. versionadded:: 2.4
    88 
    89 
    90 .. cfunction:: int PyTZInfo_CheckExact(PyObject *ob)
    91 
    92    Return true if *ob* is of type :cdata:`PyDateTime_TZInfoType`. *ob* must not be
     51.. c:function:: int PyTime_Check(PyObject *ob)
     52
     53   Return true if *ob* is of type :c:data:`PyDateTime_TimeType` or a subtype of
     54   :c:data:`PyDateTime_TimeType`.  *ob* must not be *NULL*.
     55
     56   .. versionadded:: 2.4
     57
     58
     59.. c:function:: int PyTime_CheckExact(PyObject *ob)
     60
     61   Return true if *ob* is of type :c:data:`PyDateTime_TimeType`. *ob* must not be
     62   *NULL*.
     63
     64   .. versionadded:: 2.4
     65
     66
     67.. c:function:: int PyDelta_Check(PyObject *ob)
     68
     69   Return true if *ob* is of type :c:data:`PyDateTime_DeltaType` or a subtype of
     70   :c:data:`PyDateTime_DeltaType`.  *ob* must not be *NULL*.
     71
     72   .. versionadded:: 2.4
     73
     74
     75.. c:function:: int PyDelta_CheckExact(PyObject *ob)
     76
     77   Return true if *ob* is of type :c:data:`PyDateTime_DeltaType`. *ob* must not be
     78   *NULL*.
     79
     80   .. versionadded:: 2.4
     81
     82
     83.. c:function:: int PyTZInfo_Check(PyObject *ob)
     84
     85   Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType` or a subtype of
     86   :c:data:`PyDateTime_TZInfoType`.  *ob* must not be *NULL*.
     87
     88   .. versionadded:: 2.4
     89
     90
     91.. c:function:: int PyTZInfo_CheckExact(PyObject *ob)
     92
     93   Return true if *ob* is of type :c:data:`PyDateTime_TZInfoType`. *ob* must not be
    9394   *NULL*.
    9495
     
    9899
    99100
    100 .. cfunction:: PyObject* PyDate_FromDate(int year, int month, int day)
     101.. c:function:: PyObject* PyDate_FromDate(int year, int month, int day)
    101102
    102103   Return a ``datetime.date`` object with the specified year, month and day.
     
    105106
    106107
    107 .. cfunction:: PyObject* PyDateTime_FromDateAndTime(int year, int month, int day, int hour, int minute, int second, int usecond)
     108.. c:function:: PyObject* PyDateTime_FromDateAndTime(int year, int month, int day, int hour, int minute, int second, int usecond)
    108109
    109110   Return a ``datetime.datetime`` object with the specified year, month, day, hour,
     
    113114
    114115
    115 .. cfunction:: PyObject* PyTime_FromTime(int hour, int minute, int second, int usecond)
     116.. c:function:: PyObject* PyTime_FromTime(int hour, int minute, int second, int usecond)
    116117
    117118   Return a ``datetime.time`` object with the specified hour, minute, second and
     
    121122
    122123
    123 .. cfunction:: PyObject* PyDelta_FromDSU(int days, int seconds, int useconds)
     124.. c:function:: PyObject* PyDelta_FromDSU(int days, int seconds, int useconds)
    124125
    125126   Return a ``datetime.timedelta`` object representing the given number of days,
     
    131132
    132133Macros to extract fields from date objects.  The argument must be an instance of
    133 :cdata:`PyDateTime_Date`, including subclasses (such as
    134 :cdata:`PyDateTime_DateTime`).  The argument must not be *NULL*, and the type is
     134:c:data:`PyDateTime_Date`, including subclasses (such as
     135:c:data:`PyDateTime_DateTime`).  The argument must not be *NULL*, and the type is
    135136not checked:
    136137
    137138
    138 .. cfunction:: int PyDateTime_GET_YEAR(PyDateTime_Date *o)
     139.. c:function:: int PyDateTime_GET_YEAR(PyDateTime_Date *o)
    139140
    140141   Return the year, as a positive int.
     
    143144
    144145
    145 .. cfunction:: int PyDateTime_GET_MONTH(PyDateTime_Date *o)
     146.. c:function:: int PyDateTime_GET_MONTH(PyDateTime_Date *o)
    146147
    147148   Return the month, as an int from 1 through 12.
     
    150151
    151152
    152 .. cfunction:: int PyDateTime_GET_DAY(PyDateTime_Date *o)
     153.. c:function:: int PyDateTime_GET_DAY(PyDateTime_Date *o)
    153154
    154155   Return the day, as an int from 1 through 31.
     
    157158
    158159Macros to extract fields from datetime objects.  The argument must be an
    159 instance of :cdata:`PyDateTime_DateTime`, including subclasses. The argument
     160instance of :c:data:`PyDateTime_DateTime`, including subclasses. The argument
    160161must not be *NULL*, and the type is not checked:
    161162
    162163
    163 .. cfunction:: int PyDateTime_DATE_GET_HOUR(PyDateTime_DateTime *o)
     164.. c:function:: int PyDateTime_DATE_GET_HOUR(PyDateTime_DateTime *o)
    164165
    165166   Return the hour, as an int from 0 through 23.
     
    168169
    169170
    170 .. cfunction:: int PyDateTime_DATE_GET_MINUTE(PyDateTime_DateTime *o)
     171.. c:function:: int PyDateTime_DATE_GET_MINUTE(PyDateTime_DateTime *o)
    171172
    172173   Return the minute, as an int from 0 through 59.
     
    175176
    176177
    177 .. cfunction:: int PyDateTime_DATE_GET_SECOND(PyDateTime_DateTime *o)
     178.. c:function:: int PyDateTime_DATE_GET_SECOND(PyDateTime_DateTime *o)
    178179
    179180   Return the second, as an int from 0 through 59.
     
    182183
    183184
    184 .. cfunction:: int PyDateTime_DATE_GET_MICROSECOND(PyDateTime_DateTime *o)
     185.. c:function:: int PyDateTime_DATE_GET_MICROSECOND(PyDateTime_DateTime *o)
    185186
    186187   Return the microsecond, as an int from 0 through 999999.
     
    189190
    190191Macros to extract fields from time objects.  The argument must be an instance of
    191 :cdata:`PyDateTime_Time`, including subclasses. The argument must not be *NULL*,
     192:c:data:`PyDateTime_Time`, including subclasses. The argument must not be *NULL*,
    192193and the type is not checked:
    193194
    194195
    195 .. cfunction:: int PyDateTime_TIME_GET_HOUR(PyDateTime_Time *o)
     196.. c:function:: int PyDateTime_TIME_GET_HOUR(PyDateTime_Time *o)
    196197
    197198   Return the hour, as an int from 0 through 23.
     
    200201
    201202
    202 .. cfunction:: int PyDateTime_TIME_GET_MINUTE(PyDateTime_Time *o)
     203.. c:function:: int PyDateTime_TIME_GET_MINUTE(PyDateTime_Time *o)
    203204
    204205   Return the minute, as an int from 0 through 59.
     
    207208
    208209
    209 .. cfunction:: int PyDateTime_TIME_GET_SECOND(PyDateTime_Time *o)
     210.. c:function:: int PyDateTime_TIME_GET_SECOND(PyDateTime_Time *o)
    210211
    211212   Return the second, as an int from 0 through 59.
     
    214215
    215216
    216 .. cfunction:: int PyDateTime_TIME_GET_MICROSECOND(PyDateTime_Time *o)
     217.. c:function:: int PyDateTime_TIME_GET_MICROSECOND(PyDateTime_Time *o)
    217218
    218219   Return the microsecond, as an int from 0 through 999999.
     
    223224
    224225
    225 .. cfunction:: PyObject* PyDateTime_FromTimestamp(PyObject *args)
     226.. c:function:: PyObject* PyDateTime_FromTimestamp(PyObject *args)
    226227
    227228   Create and return a new ``datetime.datetime`` object given an argument tuple
     
    231232
    232233
    233 .. cfunction:: PyObject* PyDate_FromTimestamp(PyObject *args)
     234.. c:function:: PyObject* PyDate_FromTimestamp(PyObject *args)
    234235
    235236   Create and return a new ``datetime.date`` object given an argument tuple
Note: See TracChangeset for help on using the changeset viewer.