[Python-checkins] peps: PEP 495: Added a C-API section.
alexander.belopolsky
python-checkins at python.org
Sun Aug 16 02:24:30 CEST 2015
https://hg.python.org/peps/rev/b7f301a8eac7
changeset: 5954:b7f301a8eac7
user: Alexander Belopolsky <alexander.belopolsky at gmail.com>
date: Sat Aug 15 20:24:23 2015 -0400
summary:
PEP 495: Added a C-API section.
files:
pep-0495.txt | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/pep-0495.txt b/pep-0495.txt
--- a/pep-0495.txt
+++ b/pep-0495.txt
@@ -103,6 +103,43 @@
``first`` argument is not specified, the original value of the ``first``
attribute is copied to the result.
+C-API
+.....
+
+Access macros will be defined to extract the value of ``first`` from
+``PyDateTime_DateTime`` and ``PyDateTime_Time`` objects.
+
+.. code::
+
+ bool PyDateTime_GET_FIRST(PyDateTime_DateTime *o)
+
+Return the value of ``first`` as a C99 ``bool``.
+
+.. code::
+
+ bool PyDateTime_TIME_GET_FIRST(PyDateTime_Time *o)
+
+Return the value of ``first`` as a C99 ``bool``.
+
+Additional constructors will be defined that will take an additional
+boolean argument to specify the value of ``first`` in the created
+instance:
+
+.. code::
+
+ PyObject* PyDateTime_FromDateAndTimeAndFirst(int year, int month, int day, int hour, int minute, int second, int usecond, bool first)
+
+Return a ``datetime.datetime`` object with the specified year, month,
+day, hour, minute, second, microsecond and first.
+
+.. code::
+
+ PyObject* PyTime_FromTimeAndFirst(int hour, int minute, int second, int usecond, bool first)
+
+Return a ``datetime.time`` object with the specified hour, minute,
+second, microsecond and first.
+
+
Affected Behaviors
------------------
--
Repository URL: https://hg.python.org/peps
More information about the Python-checkins
mailing list