Serhiy Storchaka wrote:
PyObject_IsInstance is not safe when used to check if the object is an instance of specified builtin type.

The __class__ attribute can be modified and PyObject_IsInstance() can return true if the object has not layout compatible with specified structure.

Code that requires a particular C layout should be using
PyObject_TypeCheck, not PyObject_IsInstance.

--
Greg

_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to