Martin v. Löwis wrote: >> I wouldn't mind letting Cython special case subtypes of str (or unicode in >> Py3) *somehow*, as long as this "somewhow" proves to be a viable solution >> that >> only applies to exactly those types *and* can be done realiably for subtypes >> of subtypes. I'm just not aware of such a solution. > > As people have pointed out: add new fields *after* the variable-sized > members. To access it, you need to compute the length of the base > object, and then cast the pointer to an extension struct. > > That extends to further subtypes, too.
Thanks Martin, Antoine, this still requires some figuring out of the details for Cython, but I agree that Cython is a good place to handle this problem and to fix it for both Py2 and whatever Py3 will add to it. Martin, you compared these things to rocket science, so let me quote a variant of what some of the Jython people tend to say: "Cython - we write C so you don't have to." Stefan _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com