Pythonic way to add method alias in subclass

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sat Dec 15 08:52:12 EST 2007


On Sat, 15 Dec 2007 13:03:33 +0000, Lee Harr wrote:

> I thought of several ways to add another name for a method in a subclass

...
> class Bar2(Foo):
>     agree = Foo.nod
...

> I am leaning towards Bar2 since it has the least code.

Sure, why not?

Out of curiosity, what's wrong with just calling Bar2.nod()?


-- 
Steven



More information about the Python-list mailing list