[Python-3000] Abilities / Interfaces

Jonathan LaCour jonathan-lists at cleverdevil.org
Sun Nov 26 05:54:36 CET 2006


Jim Jewett wrote:

>> Sorry, but that was about as informative as a "+1" vote.
>
> I found it a bit more specific on two points:
>
> What I (mis?)read was:
>
> (1)
> PJE:  Interfaces rely on buyin; they end up accidentally creating
> walled gardens.  Generic Functions make fewer demands, so they start
> to work sooner, and integrate better.  [The down side is that finding
> the relevant code -- or even being sure that it *is* is the relevant
> code, and isn't overridden elsewhere -- gets more difficult. -jJ]
>
> Jonathan:  Phillip has written a lot of long messages; this one point
> is particularly important for the summary.  It captures a (the?) key
> advantage of generic functions.

I am glad that *someone* got what I was trying to say.  Philip indeed
writes long, informative messages.  Its easy for little gems like this
one go by unnoticed.  I had not seen this relative merit of generic
functions (and disadvantage of interfaces) discussed, so I responded
with my agreement that this was very true for me in actual practice
(not just in theory).

> (2)
> Generic Functions are harder to get your head around, but once you do,
> they're worth it.  Phillip has been saying this already, but it
> matters that someone else has gotten to the point where they are
> useful and seem simple.

In fact, I used Philip's wonderful RuleDispatch module again just today
to create something quite useful.  I personally found generic functions
to be quite easy to understand, but didn't truly begin to appreciate
them until I started to use them.

So, sure, it might have been a +1 vote, but it comes with the context
that I have actually *used* both generic functions and interfaces in
practice, and have found Philip's statement above to ring very true.

--
Jonathan LaCour
http://cleverdevil.org





More information about the Python-3000 mailing list