[Python-Dev] Re: Class/type dichotomy thoughts

M.-A. Lemburg mal@lemburg.com
Tue, 07 Nov 2000 10:17:56 +0100


Greg Ewing wrote:
> 
> "M.-A. Lemburg" <mal@lemburg.com>:
> 
> > Then it sets the type id to PyDict_TypeID and Python will
> > use it as if it were an original dictionary object.
> 
> Hang on a minute. What sort of assumptions is the
> interpreter going to be making based on the fact that
> the type id is PyDict_TypeID? Can it be sure that this
> new case-insensitive dictionary doesn't break them
> somehow?
> 
> In other words, what does this new type_id thing
> actually *mean*?

For the interpreter it means that it can assume the type
interface to be binary compatible to the "original"
type, e.g. by setting the flag to say PyDict_TypeID
the type assures that all PyDict_*() APIs will work
on the type -- basically the same thing as PyDict_Check()
does now except that the type object needn't be the same
anymore.

-- 
Marc-Andre Lemburg
______________________________________________________________________
Business:                                      http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/