[Python-ideas] class-only methods without using metaclasses

Eric Snow ericsnowcurrently at gmail.com
Fri Mar 8 02:22:34 CET 2013

On Thu, Mar 7, 2013 at 4:02 PM, Greg Ewing <greg.ewing at canterbury.ac.nz> wrote:
> In Python 2 you could get class-only methods like this:

Keep in mind that there is a (perhaps subtle) difference between
methods on a metaclass and the class-only methods for which I was
advocating.  When dealing with metaclasses you have to consider things
like metaclass conflicts as well as metaclass inheritance.  Also, like
classmethods, a class-only method is looked up on the instance's MRO
and not on the class's MRO (as happens with metaclass methods).  The
difference isn't that big a deal in practice, though.


More information about the Python-ideas mailing list