Steven D'Aprano <[EMAIL PROTECTED]> writes:
> Is there a problem with writing C like this?
> class C(object):
>     def __init__(self):
>         logging.warn('Allocating resource ...')
>         self.__log = logging.warn

> It works for me. Have I missed something?

I thought the OP wanted to the program to notice when subclasses were
created, not just instances of them.  As Andreas Kraemer described,
you can do that with a metaclass.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to