[Python-Dev] PyInstance_Check() and new-style classes

Phillip J. Eby pje at telecommunity.com
Mon Jul 12 18:56:33 CEST 2004


At 11:37 AM 7/12/04 -0500, Eric Wilhelm wrote:
>So,  I think, with everybody's help, I may have found "the right way" (TM.)
>
>Should this be better documented, or is this an obscure usage?  Will it break
>in future versions of Python?

Non-heap typeness should remain an indicator of written-in-C-ness, although 
written-in-C-ness doesn't guarantee non-heapness.

IOW, if a future version of Python heap-allocates any "builtin" types, your 
test will fail.

However, it's pretty unlikely that any builtin types will ever be heap 
types, because you can't refer to their type structures as constants, 
unless they're statically allocated.

Therefore, truly core types should remain non-heap types as long as the 
current interpreter architecture is valid.



More information about the Python-Dev mailing list