diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-04-21 23:48:11 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2017-04-21 23:48:11 (GMT) |
commit | 1a5856bf9295fa73995898d576e0bedf016aee1f (patch) | |
tree | 32c1f6c2ad33c8374bc5753f520e609339962fd2 /Include/setobject.h | |
parent | a36e939aeb3b5a2c56561eb24f0e339eee9f3f9d (diff) | |
download | cpython-1a5856bf9295fa73995898d576e0bedf016aee1f.zip cpython-1a5856bf9295fa73995898d576e0bedf016aee1f.tar.gz cpython-1a5856bf9295fa73995898d576e0bedf016aee1f.tar.bz2 |
bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. (#751)
Diffstat (limited to 'Include/setobject.h')
-rw-r--r-- | Include/setobject.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/setobject.h b/Include/setobject.h index 87ec1c8..fc0ea83 100644 --- a/Include/setobject.h +++ b/Include/setobject.h @@ -64,7 +64,7 @@ typedef struct { PyObject *weakreflist; /* List of weak references */ } PySetObject; -#define PySet_GET_SIZE(so) (((PySetObject *)(so))->used) +#define PySet_GET_SIZE(so) (assert(PyAnySet_Check(so)),(((PySetObject *)(so))->used)) PyAPI_DATA(PyObject *) _PySet_Dummy; |