New style classes

Travis Oliphant oliphant at ee.byu.edu
Fri Feb 28 18:13:09 EST 2003


Forgive me if this question is naive.

I am trying to understand new-style classes.  In particular I want to be
able to detect them in C-code.

I understand that PyInstance_Check(obj) returns true in C if obj is an
instance of an old-style class.  However, it does not return true if obj
is an instance of a new-style class.

So, how does one check in C whether or not obj is an instance of a class
(either old style or new style)?

Thanks,

-Travis



-- 
Travis Oliphant
Assistant Professor
459 CB
Electrical and Computer Engineering
Brigham Young University
Provo, UT 84602
Tel: (801) 422-3108
oliphant.travis at ieee.org





More information about the Python-list mailing list