[Python] Bimorphic methods

Bob Miller kbob at jogger-egg.com
Sun Jun 15 00:29:36 PDT 2008


I just wrote an article in my 'blog about bimorphic methods.
Here's the lead-in.

> Bimorphic methods in Python
> June 15, 2008 by kernelbob
> 
> Methods in Python are either instance methods (the default), static,
> or class methods.  You can create the latter two using the
> @staticmethod and @classmethod decorators.
> 
> But maybe it would be better to have a single function that can be
> called either as a class method or an instance method.  I coined the
> term bimorphic method for this, and I wrote a decorator that can make
> a method bimorphic.

Read the whole article here (if you care).

http://kernelbob.wordpress.com/2008/06/15/bimorphic-methods-in-python/

-- 
Bob Miller                              K<bob>
                                        kbob at jogger-egg.com


More information about the Python mailing list