[Python-3000] PyUnicodeObject implementation

"Martin v. Löwis" martin at v.loewis.de
Mon Sep 8 07:07:46 CEST 2008


> Given that you can, today, subclass str in Python, without wasting an
> extra 4/8 bytes of memory, or adding anything new to the class object,
> why wouldn't anyone who really wanted to make a hypothetical optimized
> subclass just use the same mechanism (putting your additional data
> *after* the character data) to subclass it in C?
> 
> It may be a little tricky, but not exactly rocket science

I believe many people do consider it rocket science, or at least so much
out of their reach that it doesn't actually come to their mind as a
possible solution.

I'm really curious about Stefan's explanation why efficient subclassing
of str is not possible in Cython (is it not possible at all? is it
possible but inefficient? if so, how much, and why?)

Regards,
Martin


More information about the Python-3000 mailing list