diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2002-05-08 08:44:21 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2002-05-08 08:44:21 (GMT) |
commit | 01f94bda38b8f9956cfa1b227f2ebdb8ea2dfdd7 (patch) | |
tree | 07d60d276dc54212ddf73496f865f00c6821417c /Include/abstract.h | |
parent | 000e37c3c433f42bafc68eee78633da147734808 (diff) | |
download | cpython-01f94bda38b8f9956cfa1b227f2ebdb8ea2dfdd7.zip cpython-01f94bda38b8f9956cfa1b227f2ebdb8ea2dfdd7.tar.gz cpython-01f94bda38b8f9956cfa1b227f2ebdb8ea2dfdd7.tar.bz2 |
Patch #552433: Special-case tuples. Avoid sub-type checking for lists.
Avoid checks for negative indices and duplicate checks for support of
the sequence protocol.
Diffstat (limited to 'Include/abstract.h')
-rw-r--r-- | Include/abstract.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index 226e5e8..459bd56 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -1015,6 +1015,12 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ PySequence_Fast, and that i is within bounds. */ +#define PySequence_ITEM(o, i)\ + ( o->ob_type->tp_as_sequence->sq_item(o, i) ) + /* Assume tp_as_sequence and sq_item exist and that i does not + need to be corrected for a negative index + */ + DL_IMPORT(int) PySequence_Count(PyObject *o, PyObject *value); /* |