[Python-Dev] PyObject_IsInstance is dangerous
Greg Ewing
greg.ewing at canterbury.ac.nz
Mon May 18 14:14:24 CEST 2015
More information about the Python-Dev mailing list
Mon May 18 14:14:24 CEST 2015
- Previous message (by thread): [Python-Dev] PyObject_IsInstance is dangerous
- Next message (by thread): [Python-Dev] PyObject_IsInstance is dangerous
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message (by thread): [Python-Dev] PyObject_IsInstance is dangerous
- Next message (by thread): [Python-Dev] PyObject_IsInstance is dangerous
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-Dev mailing list