[Python-3000] A better way to initialize PyTypeObject
Talin
talin at acm.org
Sat Dec 2 20:17:10 CET 2006
Fredrik Lundh wrote:
> Guido van Rossum wrote:
>
>> Any volunteers? Without code this proposal is dead in the water.
>
> given that nobody's even bothered to look at Larry's patch for 2.X, it
> seems to take a bit more than just code to get something into Py3K.
> Talin obviously suffers from a serious case of NIH, but does that
> really have to apply to the entire Py3K project?
Bear in mind that what I am implementing is *not* my original proposal.
What I am implementing is the result of the discussion here, which has
diverged significantly from both your idea and mine.
To summarize the proposals:
-- You originally proposed an API that used numeric constants along with
a per-method registration function.
-- I originally proposed an API that used numeric constants stored in
the PyMethodDef table.
Based on the feedback that I've read here, there were concerns /
criticisms of both approaches. The discussion evolved towards an
approach that is table-based and uses string identifiers rather than
numeric constants.
When Guido said "I kind of like this", I'm presuming that this is in
reference to later proposals, not earlier ones.
Now, I personally don't have a problem with your way of doing it. As you
pointed out, the code-size differences with functions vs. table entries
are minimal, and numeric constants are faster to evaluate (although you
do lose the ability to transparently promote / demote methods to
'special' status.)
If the BDFL had pronounced favorably on it, I would have been happy to
support it, and would have dropped the whole issue.
However, that didn't happen. So I decided to create a patch based on
what I think *can* be approved, although there's no guarantee that it
actually will be.
So I don't think it's the case that nobody's even bothered to look at
Larry's patch; People have looked at the patch and suggested taking a
different approach.
-- Talin
More information about the Python-3000
mailing list