GZ a écrit : (snip)
Ah, this totally works. The key is to use the staticmethod function.
staticmethod is not a function, it's a class.
Another question: I am not sure how staticmethod works internally. And the python doc does not seem to say. What does it do?
It's easy to figure this out once you understand how Python turns functions into methods: http://wiki.python.org/moin/FromFunctionToMethod
Basically, the staticmethod type acts as a descriptor wrapper around the function object that short-circuits the function object's own descriptor implementation and yields the function.
-- http://mail.python.org/mailman/listinfo/python-list