• Kevin Modzelewski's avatar
    Support extension classes that specify tp_dictoffset · 5b2747b1
    Kevin Modzelewski authored
    I think there are a couple ways we can go about this.  It looks like
    extensions just specify tp_dictoffset if they want their instances
    to have instance attributes, but don't usually actually look at the
    dict or really make use of the fact that it's a real dict.  So possibly,
    we have the ability to stuff a non-dict into the slot they reserved for
    us.
    
    Seems risky though.  Instead, the approach in this commit is to create
    an actual dict and put it in like they expect.  All the attribute-accessing
    paths have been updated to look at both the fast Pyston HCAttrs method, and
    the CAPI dict method.
    5b2747b1
types.cpp 40 KB