[issue15390] PEP 3121, 384 refactoring applied to datetime module

Alexander Belopolsky report at bugs.python.org
Mon Sep 10 04:46:41 CEST 2012


Alexander Belopolsky added the comment:

For some reason there are no review links, so I'll review in this message.

Include/datetime.h

+typedef struct {
..
+} _datetimemodulestate;

Names exposed in public headers (datetime.h is a public header) should start with Py or _Py. Other offenders include _datetimemodule_state, _datetimemodule, _datetimemodulestate_global.

I don't think these names need to be defined in the header file at all.  

+typedef struct {
+    /* Forward declarations. */
+    PyObject *PyDateTime_DateType;
+    PyObject *PyDateTime_DateTimeType;
...

These are not forward declarations anymore.  There is no need for PyDateTime_ prefix.  Use names from  PyDateTime_CAPI struct.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue15390>
_______________________________________


More information about the Python-bugs-list mailing list