PySequence_Check is always true on instances?

Walter Moreira wall at adinet.com.uy
Fri Mar 22 16:24:02 EST 2002


Hi. If I define a simple class

   >>> class eggs:
   ...     pass
   >>> a = eggs()

and I call PySequence_Check on the instance 'a', at C level, it returns 1. If
the class is a new style class:

   >>> class eggs(object):
   ...     pass
   >>> b = eggs()

then PySequence_Check on 'b' returns 0. I proved this on Python 2.2 and 2.1
(couldn't download 2.2.1 yet).

Is this a bug? If it is not a bug, which is the standard way to check that an
object is sequence, in C?

Thanks.
Walter




More information about the Python-list mailing list