changing __call__ on demand

Michael Hoffman cam.ac.uk at mh391.invalid
Sun Feb 13 12:11:50 EST 2005


Stefan Behnel wrote:
> Is there a way to change __call__ after class creation?

__call__, like __getitem__, and __getattr__ is called on the
class object, not the instance object. So, no, not as far as I
am aware, without using metaclass trickery. The simplest option
IMO is to use another level of indirection as you suggest.
-- 
Michael Hoffman



More information about the Python-list mailing list