mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
Issue #19730: Argument Clinic now supports all the existing PyArg
"format units" as legacy converters, as well as two new features: "self converters" and the "version" directive.
This commit is contained in:
parent
3a9079742f
commit
ebdcb50b8a
9 changed files with 468 additions and 157 deletions
|
|
@ -4167,10 +4167,10 @@ PyDoc_STRVAR(datetime_datetime_now__doc__,
|
|||
{"now", (PyCFunction)datetime_datetime_now, METH_VARARGS|METH_KEYWORDS|METH_CLASS, datetime_datetime_now__doc__},
|
||||
|
||||
static PyObject *
|
||||
datetime_datetime_now_impl(PyObject *cls, PyObject *tz);
|
||||
datetime_datetime_now_impl(PyTypeObject *cls, PyObject *tz);
|
||||
|
||||
static PyObject *
|
||||
datetime_datetime_now(PyObject *cls, PyObject *args, PyObject *kwargs)
|
||||
datetime_datetime_now(PyTypeObject *cls, PyObject *args, PyObject *kwargs)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
static char *_keywords[] = {"tz", NULL};
|
||||
|
|
@ -4187,8 +4187,8 @@ exit:
|
|||
}
|
||||
|
||||
static PyObject *
|
||||
datetime_datetime_now_impl(PyObject *cls, PyObject *tz)
|
||||
/*[clinic checksum: cde1daca68c9b7dca6df51759db2de1d43a39774]*/
|
||||
datetime_datetime_now_impl(PyTypeObject *cls, PyObject *tz)
|
||||
/*[clinic checksum: 5e61647d5d1feaf1ab096c5406ccea17bb7b061c]*/
|
||||
{
|
||||
PyObject *self;
|
||||
|
||||
|
|
@ -4198,7 +4198,7 @@ datetime_datetime_now_impl(PyObject *cls, PyObject *tz)
|
|||
if (check_tzinfo_subclass(tz) < 0)
|
||||
return NULL;
|
||||
|
||||
self = datetime_best_possible(cls,
|
||||
self = datetime_best_possible((PyObject *)cls,
|
||||
tz == Py_None ? localtime : gmtime,
|
||||
tz);
|
||||
if (self != NULL && tz != Py_None) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue