Skip to content

Commit 1ee0e14

Browse files
committed
Unified Py.EmptyTuple and PyTuple.EMPTY_TUPLE. Non-uniqueness of this constant caused inconvenience in JyNI. Minor doc-cosmetics in gc module.
1 parent 1154305 commit 1ee0e14

2 files changed

Lines changed: 137 additions & 116 deletions

File tree

src/org/python/core/PyTuple.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ public class PyTuple extends PySequenceList implements List {
2626

2727
private volatile List<PyObject> cachedList = null;
2828

29-
private static final PyTuple EMPTY_TUPLE = new PyTuple();
30-
3129
public PyTuple() {
3230
this(TYPE, Py.EmptyObjects);
3331
}
@@ -79,7 +77,7 @@ final static PyObject tuple_new(PyNewWrapper new_, boolean init, PyType subtype,
7977
PyObject S = ap.getPyObject(0, null);
8078
if (new_.for_type == subtype) {
8179
if (S == null) {
82-
return EMPTY_TUPLE;
80+
return Py.EmptyTuple;
8381
}
8482
if (S instanceof PyTupleDerived) {
8583
return new PyTuple(((PyTuple) S).getArray());
@@ -136,7 +134,7 @@ protected PyObject repeat(int count) {
136134
return this;
137135
}
138136
if (size == 0) {
139-
return EMPTY_TUPLE;
137+
return Py.EmptyTuple;
140138
}
141139
}
142140

0 commit comments

Comments
 (0)