Skip to content

Commit e449af7

Browse files
committed
Ellipses -> Ellipsis rename (the dictionary really says that it should
be Ellipsis!). Bumped the API version because a linker-visible symbol is affected. Old C code will still compile -- there's a b/w compat macro. Similarly, old Python code will still run, builtin exports both Ellipses and Ellipsis.
1 parent 8741b2b commit e449af7

File tree

7 files changed

+28
-24
lines changed

7 files changed

+28
-24
lines changed

Include/modsupport.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ extern PyObject *Py_BuildValue();
5252
extern int PyArg_VaParse Py_PROTO((PyObject *, char *, va_list));
5353
extern PyObject *Py_VaBuildValue Py_PROTO((char *, va_list));
5454

55-
#define PYTHON_API_VERSION 1005
56-
#define PYTHON_API_STRING "1005"
55+
#define PYTHON_API_VERSION 1006
56+
#define PYTHON_API_STRING "1006"
5757
/* The API version is maintained (independently from the Python version)
5858
so we can detect mismatches between the interpreter and dynamically
5959
loaded modules. These are diagnosticised by an error message but
@@ -67,6 +67,8 @@ extern PyObject *Py_VaBuildValue Py_PROTO((char *, va_list));
6767
Please add a line or two to the top of this log for each API
6868
version change:
6969
70+
11-Oct-1996 GvR renamed Py_Ellipses to Py_Ellipsis :-(
71+
7072
30-Jul-1996 GvR Slice and ellipses syntax added
7173
7274
23-Jul-1996 GvR For 1.4 -- better safe than sorry this time :-)

Include/sliceobject.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
extern "C" {
55
#endif
66

7-
/* The unique ellipses object "..." */
7+
/* The unique ellipsis object "..." */
88

9-
extern DL_IMPORT(PyObject) _Py_EllipsesObject; /* Don't use this directly */
10-
11-
#define Py_Ellipses (&_Py_EllipsesObject)
9+
extern DL_IMPORT(PyObject) _Py_EllipsisObject; /* Don't use this directly */
1210

11+
#define Py_Ellipsis (&_Py_EllipsisObject)
12+
#define Py_Ellipses Py_Ellipsis /* For bad spellers like me :-( */
1313

1414
/* Slice object interface */
1515

Lib/types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,6 @@ def _m(self): pass
4848
FrameType = type(sys.exc_traceback.tb_frame)
4949

5050
SliceType = type(slice(0))
51-
EllipsesType = type(Ellipses)
51+
EllipsisType = type(Ellipsis)
5252

5353
del sys, _f, _C, _x # Not for export

Objects/sliceobject.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,47 @@
11
/*
22
Written by Jim Hugunin and Chris Chase.
33
4-
This includes both the singular ellipses object and slice objects.
4+
This includes both the singular ellipsis object and slice objects.
55
66
Guido, feel free to do whatever you want in the way of copyrights
77
for this file.
88
*/
99

1010
/*
11-
Py_Ellipses encodes the '...' rubber index token. It is similar to
11+
Py_Ellipsis encodes the '...' rubber index token. It is similar to
1212
the Py_NoneStruct in that there is no way to create other objects of
1313
this type and there is exactly one in existence.
1414
*/
1515

1616
#include "Python.h"
1717

1818
static PyObject *
19-
ellipses_repr(op)
19+
ellipsis_repr(op)
2020
PyObject *op;
2121
{
22-
return PyString_FromString("Ellipses");
22+
return PyString_FromString("Ellipsis");
2323
}
2424

25-
static PyTypeObject PyEllipses_Type = {
25+
static PyTypeObject PyEllipsis_Type = {
2626
PyObject_HEAD_INIT(&PyType_Type)
2727
0,
28-
"ellipses",
28+
"ellipsis",
2929
0,
3030
0,
3131
0, /*tp_dealloc*/ /*never called*/
3232
0, /*tp_print*/
3333
0, /*tp_getattr*/
3434
0, /*tp_setattr*/
3535
0, /*tp_compare*/
36-
(reprfunc)ellipses_repr, /*tp_repr*/
36+
(reprfunc)ellipsis_repr, /*tp_repr*/
3737
0, /*tp_as_number*/
3838
0, /*tp_as_sequence*/
3939
0, /*tp_as_mapping*/
4040
0, /*tp_hash */
4141
};
4242

43-
PyObject _Py_EllipsesObject = {
44-
PyObject_HEAD_INIT(&PyEllipses_Type)
43+
PyObject _Py_EllipsisObject = {
44+
PyObject_HEAD_INIT(&PyEllipsis_Type)
4545
};
4646

4747

Python/bltinmodule.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,9 @@ initbuiltin()
16321632
INCREF(builtin_dict);
16331633
initerrors();
16341634
(void) dictinsert(builtin_dict, "None", None);
1635-
(void) dictinsert(builtin_dict, "Ellipses", Py_Ellipses);
1635+
(void) dictinsert(builtin_dict, "Ellipsis", Py_Ellipsis);
1636+
/* And once more for bad spellers like me :-( */
1637+
(void) dictinsert(builtin_dict, "Ellipses", Py_Ellipsis);
16361638
}
16371639

16381640

Python/compile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,7 +1032,7 @@ com_subscript(c, n)
10321032
ch = CHILD(n,0);
10331033
/* check for rubber index */
10341034
if (TYPE(ch) == DOT && TYPE(CHILD(n,1)) == DOT)
1035-
com_addoparg(c, LOAD_CONST, com_addconst(c, Py_Ellipses));
1035+
com_addoparg(c, LOAD_CONST, com_addconst(c, Py_Ellipsis));
10361036
else {
10371037
/* check for slice */
10381038
if ((TYPE(ch) == COLON || NCH(n) > 1))

Python/marshal.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3737

3838
#define TYPE_NULL '0'
3939
#define TYPE_NONE 'N'
40-
#define TYPE_ELLIPSES '.'
40+
#define TYPE_ELLIPSIS '.'
4141
#define TYPE_INT 'i'
4242
#define TYPE_FLOAT 'f'
4343
#define TYPE_COMPLEX 'x'
@@ -130,8 +130,8 @@ w_object(v, p)
130130
w_byte(TYPE_NULL, p);
131131
else if (v == None)
132132
w_byte(TYPE_NONE, p);
133-
else if (v == Py_Ellipses)
134-
w_byte(TYPE_ELLIPSES, p);
133+
else if (v == Py_Ellipsis)
134+
w_byte(TYPE_ELLIPSIS, p);
135135
else if (is_intobject(v)) {
136136
w_byte(TYPE_INT, p);
137137
w_long(getintvalue(v), p);
@@ -325,9 +325,9 @@ r_object(p)
325325
INCREF(None);
326326
return None;
327327

328-
case TYPE_ELLIPSES:
329-
INCREF(Py_Ellipses);
330-
return Py_Ellipses;
328+
case TYPE_ELLIPSIS:
329+
INCREF(Py_Ellipsis);
330+
return Py_Ellipsis;
331331

332332
case TYPE_INT:
333333
return newintobject(r_long(p));

0 commit comments

Comments
 (0)