mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
Add values to tp_getattro and tp_flags so that dir(Ellipsis) will
return the same as dir(None).
This commit is contained in:
parent
ed87ad876b
commit
d82fb78b5c
1 changed files with 20 additions and 14 deletions
|
@ -24,11 +24,11 @@ ellipsis_repr(PyObject *op)
|
||||||
|
|
||||||
static PyTypeObject PyEllipsis_Type = {
|
static PyTypeObject PyEllipsis_Type = {
|
||||||
PyObject_HEAD_INIT(&PyType_Type)
|
PyObject_HEAD_INIT(&PyType_Type)
|
||||||
0,
|
0, /* ob_size */
|
||||||
"ellipsis",
|
"ellipsis", /* tp_name */
|
||||||
0,
|
0, /* tp_basicsize */
|
||||||
0,
|
0, /* tp_itemsize */
|
||||||
0, /*tp_dealloc*/ /*never called*/
|
0, /*never called*/ /* tp_dealloc */
|
||||||
0, /* tp_print */
|
0, /* tp_print */
|
||||||
0, /* tp_getattr */
|
0, /* tp_getattr */
|
||||||
0, /* tp_setattr */
|
0, /* tp_setattr */
|
||||||
|
@ -38,6 +38,12 @@ static PyTypeObject PyEllipsis_Type = {
|
||||||
0, /* tp_as_sequence */
|
0, /* tp_as_sequence */
|
||||||
0, /* tp_as_mapping */
|
0, /* tp_as_mapping */
|
||||||
0, /* tp_hash */
|
0, /* tp_hash */
|
||||||
|
0, /* tp_call */
|
||||||
|
0, /* tp_str */
|
||||||
|
PyObject_GenericGetAttr, /* tp_getattro */
|
||||||
|
0, /* tp_setattro */
|
||||||
|
0, /* tp_as_buffer */
|
||||||
|
Py_TPFLAGS_DEFAULT, /* tp_flags */
|
||||||
};
|
};
|
||||||
|
|
||||||
PyObject _Py_EllipsisObject = {
|
PyObject _Py_EllipsisObject = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue