[pypy-dev] question

Christian Tismer tismer at tismer.com
Sat Mar 1 19:25:41 CET 2003

Samuele Pedroni wrote:
> I admit for now I have just skimmed over the code.
> I can more or less see how something like classic-style classes can be
> implemented.
> Have you already thought on how to implement new-style classes and in
> particular built-in types subclassing like in:
> class myint(int):
>   ...
> e.g. will the implemented multi-dispatching intepreted statically at PyPy
> static translation time ... or should the final low-level runtime support it
> dynamically?

Speaking for myself, I always have wondered how the
multimethod approach should be extended above the
level of builtin types, since I don't understand
how to extend it to derived types, without breaking
compatibility to all the established __xxx__ rules
in Python.
I pointed to this problem on the sprint, but can't remember
that this issue was solved.

One vague idea could be that derived types by default
inherit the multi-method dispatch, but when people override
operators, we have to provide some compatible interpretation
of things like __add__(self, other), or this would not be
Python. Maybe we can find the necessary magic to embed this
into multimethod dispatch dynamically, but I have
really no clue how this should work.

ciao - chris

Christian Tismer             :^)   <mailto:tismer at tismer.com>
Mission Impossible 5oftware  :     Have a break! Take a ride on Python's
Johannes-Niemeyer-Weg 9a     :    *Starship* http://starship.python.net/
14109 Berlin                 :     PGP key -> http://wwwkeys.pgp.net/
work +49 30 89 09 53 34  home +49 30 802 86 56  pager +49 173 24 18 776
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
      whom do you want to sponsor today?   http://www.stackless.com/

More information about the Pypy-dev mailing list