[Python-Dev] Need a way to test for 8-bit-or-unicode-string (original) (raw)

Neil Schemenauer nas@python.ca
Fri, 5 Oct 2001 09:42:09 -0700


Guido van Rossum wrote:

Here's an implementation of Neil's idea.

*** abstract.c 2001/10/01 17:10:18 2.83 --- abstract.c 2001/10/05 15:49:04 *************** *** 1805,1810 **** --- 1805,1829 ---- else if (PyTypeCheck(cls)) { retval = PyObjectTypeCheck(inst, (PyTypeObject *)cls); } + else if (PySequenceCheck(cls)) { + int i, n;

Is is possible that a type also passes PySequence_Check? If so, that could lead to confusing behavior.

Neil