FEEDBACK WANTED: Type/class unification

Guido van Rossum guido at python.org
Thu Aug 2 08:38:20 EDT 2001


tanzer at swing.co.at (Christian Tanzer) writes:

> BTW, you wrote that in 2.2 classes will behave like God <wink>
> meant them to behave and that they will be totally unified with types
> in a later release. Would that be 2.3? And how would classes change --
> besides using the shiny new lookup rule?

I'm not done thinking about that.  If you have suggestions, mail me.
This is PEP 254 material, and that's an empty PEP if there ever was
one. :-)

> > > Do you have a name for the new lookup rule?
> > =
> 
> > Not yet.  Does it need one?
> 
> I think so. It's hard talking about (and teaching) it otherwise. And
> `new lookup rule` will age quickly.

Hm.  I really can't come up with anything.

> Did you invent this rule for yourself or did you steal it from another
> language?

Stole it, but not from a specific language.  It's from the book:

    [1] "Putting Metaclasses to Work", by Ira R. Forman and Scott
        H. Danforth, Addison-Wesley 1999.
        (http://www.aw.com/product/0,2627,0201433052,00.html)

They don't have a name for it either.

I *think* it's the same rule that C++ uses, but C++ has additional
rules about conflict that make it feel different.

Hey, I just came up with something.  The motivation in [1] is to
enable cooperation between classes.  How about calling it the
"cooperative method resolution order" (CMRO for short).

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list