summaryrefslogtreecommitdiffstats
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2019-03-05 18:42:06 (GMT)
committerGitHub <noreply@github.com>2019-03-05 18:42:06 (GMT)
commitd8b3a98c9098c66a714fd5593e1928af0ffbc631 (patch)
treedc9c2290f796ec697adcfa12942f773646f8f13c /Python/Python-ast.c
parentadfffc7343ce7ebc88ec734a803d3247ba8927fb (diff)
downloadcpython-d8b3a98c9098c66a714fd5593e1928af0ffbc631.zip
cpython-d8b3a98c9098c66a714fd5593e1928af0ffbc631.tar.gz
cpython-d8b3a98c9098c66a714fd5593e1928af0ffbc631.tar.bz2
bpo-36187: Remove NamedStore. (GH-12167)
NamedStore has been replaced with Store. The difference between NamedStore and Store is handled when precess the NamedExpr node one level upper.
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r--Python/Python-ast.c21
1 files changed, 1 insertions, 20 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index 5467d19..92ec157 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -365,8 +365,7 @@ static char *Tuple_fields[]={
};
static PyTypeObject *expr_context_type;
static PyObject *Load_singleton, *Store_singleton, *Del_singleton,
-*AugLoad_singleton, *AugStore_singleton, *Param_singleton,
-*NamedStore_singleton;
+*AugLoad_singleton, *AugStore_singleton, *Param_singleton;
static PyObject* ast2obj_expr_context(expr_context_ty);
static PyTypeObject *Load_type;
static PyTypeObject *Store_type;
@@ -374,7 +373,6 @@ static PyTypeObject *Del_type;
static PyTypeObject *AugLoad_type;
static PyTypeObject *AugStore_type;
static PyTypeObject *Param_type;
-static PyTypeObject *NamedStore_type;
static PyTypeObject *slice_type;
static PyObject* ast2obj_slice(void*);
static PyTypeObject *Slice_type;
@@ -993,10 +991,6 @@ static int init_types(void)
if (!Param_type) return 0;
Param_singleton = PyType_GenericNew(Param_type, NULL, NULL);
if (!Param_singleton) return 0;
- NamedStore_type = make_type("NamedStore", expr_context_type, NULL, 0);
- if (!NamedStore_type) return 0;
- NamedStore_singleton = PyType_GenericNew(NamedStore_type, NULL, NULL);
- if (!NamedStore_singleton) return 0;
slice_type = make_type("slice", &AST_type, NULL, 0);
if (!slice_type) return 0;
if (!add_attributes(slice_type, NULL, 0)) return 0;
@@ -3657,9 +3651,6 @@ PyObject* ast2obj_expr_context(expr_context_ty o)
case Param:
Py_INCREF(Param_singleton);
return Param_singleton;
- case NamedStore:
- Py_INCREF(NamedStore_singleton);
- return NamedStore_singleton;
default:
/* should never happen, but just in case ... */
PyErr_Format(PyExc_SystemError, "unknown expr_context found");
@@ -7608,14 +7599,6 @@ obj2ast_expr_context(PyObject* obj, expr_context_ty* out, PyArena* arena)
*out = Param;
return 0;
}
- isinstance = PyObject_IsInstance(obj, (PyObject *)NamedStore_type);
- if (isinstance == -1) {
- return 1;
- }
- if (isinstance) {
- *out = NamedStore;
- return 0;
- }
PyErr_Format(PyExc_TypeError, "expected some sort of expr_context, but got %R", obj);
return 1;
@@ -8828,8 +8811,6 @@ PyInit__ast(void)
return NULL;
if (PyDict_SetItemString(d, "Param", (PyObject*)Param_type) < 0) return
NULL;
- if (PyDict_SetItemString(d, "NamedStore", (PyObject*)NamedStore_type) < 0)
- return NULL;
if (PyDict_SetItemString(d, "slice", (PyObject*)slice_type) < 0) return
NULL;
if (PyDict_SetItemString(d, "Slice", (PyObject*)Slice_type) < 0) return