[pypy-dev] getting rid of multimethods?
hpk at trillke.net
Sat Jun 26 13:16:59 CEST 2004
[Armin Rigo Wed, Jun 23, 2004 at 05:01:45PM +0100]
> On Thu, Jun 17, 2004 at 08:10:41AM +0200, Laura Creighton wrote:
> > There is a niceness about how the multimethods group everything in one
> > place.
> Yes, their declarativeness is nice. I don't think we should remove them, but
> maybe we should move them away from run-time.
> It would be possible to use the multimethod declarations only to generate
> Python sources with the descriptors (i.e. the __add__&co methods). The type
> switches would be generated too.
Might be helpful.
> This is basically what Holger suggested for descroperation.py already. I
> still think that it is overkill for descroperation.py, but for multimethods it
> would be helpful as a check, or if you prefer reading the generated Python
> source instead of the multimethod.py magic.
Well, in my tree i moved some of the multimethod-declarations (getitem/setitem) for
the dictobject into some dict-specific descriptors. I could reuse the existing
methods without any modification. It's faster and easier to understand.
But i see your point that in other cases the declarativeness of
multimethods is nice. But I do think that their existence complicates
the understanding of PyPy (at least for me :-).
More information about the Pypy-dev