Christian Tismer <tis...@stackless.com> added the comment: > ... Specifically, you need a way to create class with a metaclass, from C. > > Is that right? Or was this only an example of a larger problem?
Yes, you are exactly right. I needed access to very few fields. In particular: PyTypeObject.tp_init PyTypeObject.tp_basicsize (workaround using Python) <a_few_types>.tp_dict The latter would not be necessary for Pep 384, but for my __signature__ extension, but that is another story :) <basicsize> > Well, basicsize might be exposed through Python, but it's still not > part of the limited API. Which is fine – all that means is you might > need to change the extension for some future version of Python. Oh? I thought it is automatically allowed to use if it is exposed by Python. I thought that the central property of basicsize would be that it is no longer a constant, but that a size is always there. Sure, we could have worked without the size and create a more complex structure that does not know anything about types. I actually started with that approach. But in the end I thought it would not hurt to assume that there is a (variable) size, as long as we are below Python 4.0 . > I'm sure your tests will tell you when the time comes, and I hope we'll > have a better solution then! Yes, I had a very hard time to convince myself that I _may_ use some assumptions, as long as I always prove that these assumptions are right. But in a way, I feel guilty and would prefer to go without any trickery. > BTW, I'm honestly very impressed how far PySide got with the limited API! Thank you! I was hoping to get ready after 2 months, when I realized that all types needed to be changed. So I pulled teeth, and it took >5 months. Btw., I don't understand how the PyQt5 guy(s) solved this. Maybe his structure is way cleaner and simpler than the PySide mess? I'll ask him. Ciao -- Chris ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue26979> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com