Martin v. Löwis <mar...@v.loewis.de> added the comment:

The fast subtype checks cannot be supported in the limited API, as the layout 
of type objects is intentionally not exposed. It would be possible to expose a 
getter for the type flags; the individual flag values *are* part of the ABI.

I propose the attached patch, which replaces the fast subtype check with a slow 
one in the limited API. The patch would need to be extended to all subtype 
checks.

It's not strictly necessary to include this patch into the 3.2 release; users 
could also explicitly call PyObject_IsSubclass as a work-around. The patch 
could then be added for 3.2.1.

As another work-around, users can also use PyUnicode_CheckExact, which is even 
faster and might be correct in many cases as well.

----------
keywords: +patch
Added file: http://bugs.python.org/file20644/unisub.diff

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue11067>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to