Emulating classmethod in Python 2.1

Hamish Lawson hamish_lawson at yahoo.co.uk
Fri Jun 7 10:11:09 EDT 2002


Thomas Heller wrote:

> Here's the closest I came up with (you must rewrite your code to
> derive SomeClass from object, the rest can remain unchanged). ...

While ideally I was hoping not to have change any client code, your
solution is the next best thing in requiring only a minimal change and
in working with both Python 2.2's builtin classmethod() and with an
emulating wrapper. Thanks!

Hamish



More information about the Python-list mailing list