method that can be called from a class and also from an instance

Steven D'Aprano steve+comp.lang.python at
Fri Nov 23 05:23:22 CET 2012

On Thu, 22 Nov 2012 07:14:29 -0800, Marc Aymerich wrote:

> Hi,
> I want to create a method within a class that is able to accept either a
> class or an instance.

You want my "dualmethod" decorator:


More information about the Python-list mailing list