diff options
author | Thomas Wouters <thomas@python.org> | 2000-08-24 20:09:45 (GMT) |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2000-08-24 20:09:45 (GMT) |
commit | dd8dbdb7172fbafb5ffab8600e620103fc19879e (patch) | |
tree | d0706f5e94cb061057f85138e8637885c9f4cb57 /Include/object.h | |
parent | e289e0bd0c3db9755bb2ddd49b08091049bc301d (diff) | |
download | cpython-dd8dbdb7172fbafb5ffab8600e620103fc19879e.zip cpython-dd8dbdb7172fbafb5ffab8600e620103fc19879e.tar.gz cpython-dd8dbdb7172fbafb5ffab8600e620103fc19879e.tar.bz2 |
The real suport for augmented assignment: new opcodes, new PyNumber and
PySequence methods and functions, new tokens.
Diffstat (limited to 'Include/object.h')
-rw-r--r-- | Include/object.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/Include/object.h b/Include/object.h index 72a5282..0cfa179 100644 --- a/Include/object.h +++ b/Include/object.h @@ -151,6 +151,17 @@ typedef struct { unaryfunc nb_float; unaryfunc nb_oct; unaryfunc nb_hex; + binaryfunc nb_inplace_add; + binaryfunc nb_inplace_subtract; + binaryfunc nb_inplace_multiply; + binaryfunc nb_inplace_divide; + binaryfunc nb_inplace_remainder; + ternaryfunc nb_inplace_power; + binaryfunc nb_inplace_lshift; + binaryfunc nb_inplace_rshift; + binaryfunc nb_inplace_and; + binaryfunc nb_inplace_xor; + binaryfunc nb_inplace_or; } PyNumberMethods; typedef struct { @@ -162,6 +173,8 @@ typedef struct { intobjargproc sq_ass_item; intintobjargproc sq_ass_slice; objobjproc sq_contains; + binaryfunc sq_inplace_concat; + intargfunc sq_inplace_repeat; } PySequenceMethods; typedef struct { @@ -315,8 +328,12 @@ given type object has a specified feature. #define Py_TPFLAGS_GC 0 #endif +/* PySequenceMethods and PyNumberMethods contain in-place operators */ +#define Py_TPFLAGS_HAVE_INPLACEOPS (1L<<3) + #define Py_TPFLAGS_DEFAULT (Py_TPFLAGS_HAVE_GETCHARBUFFER | \ - Py_TPFLAGS_HAVE_SEQUENCE_IN) + Py_TPFLAGS_HAVE_SEQUENCE_IN | \ + Py_TPFLAGS_HAVE_INPLACEOPS) #define PyType_HasFeature(t,f) (((t)->tp_flags & (f)) != 0) |