mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
PEP 448: additional unpacking generalizations (closes #2292)
Patch by Neil Girdhar.
This commit is contained in:
parent
4ccc1514d0
commit
025e9ebd0a
26 changed files with 2664 additions and 2118 deletions
|
@ -84,8 +84,6 @@ struct _stmt {
|
|||
identifier name;
|
||||
asdl_seq *bases;
|
||||
asdl_seq *keywords;
|
||||
expr_ty starargs;
|
||||
expr_ty kwargs;
|
||||
asdl_seq *body;
|
||||
asdl_seq *decorator_list;
|
||||
} ClassDef;
|
||||
|
@ -263,8 +261,6 @@ struct _expr {
|
|||
expr_ty func;
|
||||
asdl_seq *args;
|
||||
asdl_seq *keywords;
|
||||
expr_ty starargs;
|
||||
expr_ty kwargs;
|
||||
} Call;
|
||||
|
||||
struct {
|
||||
|
@ -406,11 +402,10 @@ mod_ty _Py_Suite(asdl_seq * body, PyArena *arena);
|
|||
stmt_ty _Py_FunctionDef(identifier name, arguments_ty args, asdl_seq * body,
|
||||
asdl_seq * decorator_list, expr_ty returns, int lineno,
|
||||
int col_offset, PyArena *arena);
|
||||
#define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)
|
||||
#define ClassDef(a0, a1, a2, a3, a4, a5, a6, a7) _Py_ClassDef(a0, a1, a2, a3, a4, a5, a6, a7)
|
||||
stmt_ty _Py_ClassDef(identifier name, asdl_seq * bases, asdl_seq * keywords,
|
||||
expr_ty starargs, expr_ty kwargs, asdl_seq * body,
|
||||
asdl_seq * decorator_list, int lineno, int col_offset,
|
||||
PyArena *arena);
|
||||
asdl_seq * body, asdl_seq * decorator_list, int lineno,
|
||||
int col_offset, PyArena *arena);
|
||||
#define Return(a0, a1, a2, a3) _Py_Return(a0, a1, a2, a3)
|
||||
stmt_ty _Py_Return(expr_ty value, int lineno, int col_offset, PyArena *arena);
|
||||
#define Delete(a0, a1, a2, a3) _Py_Delete(a0, a1, a2, a3)
|
||||
|
@ -504,10 +499,9 @@ expr_ty _Py_YieldFrom(expr_ty value, int lineno, int col_offset, PyArena
|
|||
#define Compare(a0, a1, a2, a3, a4, a5) _Py_Compare(a0, a1, a2, a3, a4, a5)
|
||||
expr_ty _Py_Compare(expr_ty left, asdl_int_seq * ops, asdl_seq * comparators,
|
||||
int lineno, int col_offset, PyArena *arena);
|
||||
#define Call(a0, a1, a2, a3, a4, a5, a6, a7) _Py_Call(a0, a1, a2, a3, a4, a5, a6, a7)
|
||||
expr_ty _Py_Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, expr_ty
|
||||
starargs, expr_ty kwargs, int lineno, int col_offset, PyArena
|
||||
*arena);
|
||||
#define Call(a0, a1, a2, a3, a4, a5) _Py_Call(a0, a1, a2, a3, a4, a5)
|
||||
expr_ty _Py_Call(expr_ty func, asdl_seq * args, asdl_seq * keywords, int
|
||||
lineno, int col_offset, PyArena *arena);
|
||||
#define Num(a0, a1, a2, a3) _Py_Num(a0, a1, a2, a3)
|
||||
expr_ty _Py_Num(object n, int lineno, int col_offset, PyArena *arena);
|
||||
#define Str(a0, a1, a2, a3) _Py_Str(a0, a1, a2, a3)
|
||||
|
|
|
@ -105,6 +105,10 @@ PyAPI_FUNC(int) PyDict_Merge(PyObject *mp,
|
|||
PyObject *other,
|
||||
int override);
|
||||
|
||||
#ifndef Py_LIMITED_API
|
||||
PyAPI_FUNC(PyObject *) _PyDictView_Intersect(PyObject* self, PyObject *other);
|
||||
#endif
|
||||
|
||||
/* PyDict_MergeFromSeq2 updates/merges from an iterable object producing
|
||||
iterable objects of length 2. If override is true, the last occurrence
|
||||
of a key wins, else the first. The Python dict constructor dict(seq2)
|
||||
|
|
|
@ -111,6 +111,11 @@ extern "C" {
|
|||
#define SET_ADD 146
|
||||
#define MAP_ADD 147
|
||||
#define LOAD_CLASSDEREF 148
|
||||
#define BUILD_LIST_UNPACK 149
|
||||
#define BUILD_MAP_UNPACK 150
|
||||
#define BUILD_MAP_UNPACK_WITH_CALL 151
|
||||
#define BUILD_TUPLE_UNPACK 152
|
||||
#define BUILD_SET_UNPACK 153
|
||||
|
||||
/* EXCEPT_HANDLER is a special, implicit block type which is created when
|
||||
entering an except handler. It is not an opcode but we define it here
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue