method = Klass.othermethod considered PITA

Erik Max Francis max at alcyone.com
Sun Jun 5 13:28:48 EDT 2005


Steven Bethard wrote:

> Well if you want these to work with subclasses that change verb_hello to 
> do something else, one option is to write a simple decorator, and then 
> your lines above become something like:

Note I was just giving a use case for the general construct, not 
necessarily a use case for the pseudofeature the original poster was 
requesting.  In my particular case, there isn't much need to make sure 
things are properly overridden in subclasses, since functionality tends 
to get added, rather than modified.  (The "Why would you want to do 
that?" question was asked before he went on to show what wasn't working 
for him.)

-- 
Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/
San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis
   To understand is to forgive, even oneself.
   -- Alexander Chase



More information about the Python-list mailing list