anton muhin wrote:
anton muhin wrote:

Correction:

Of course, I can imagine some metaclasses magic that would allow to code:

class MyClass(WithOverloading):
  @overloadMethod(A)
  def someMetod(self, _): ...

But it would rather convoluted: the best idea I have so far is to mangle methods name in the manner most of C++ compilers do.

PEAK has a fairly sophisticated implementation of method dispatch you may want to look at.


http://peak.telecommunity.com/Articles/WhatisPEAK.html
http://dirtsimple.org/2004/11/generic-functions-have-landed.html
http://peak.telecommunity.com/doc/src/dispatch/__init__.html

I'm compelled to point out that PEAK should still be considered a 'work in progress', but PJE's ideas should help you out :)

Cheers,
Nick.

--
Nick Coghlan   |   [EMAIL PROTECTED]   |   Brisbane, Australia
---------------------------------------------------------------
            http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to