Keeping track of subclasses and instances?
Paul Rubin
http
Thu Oct 11 03:21:59 EDT 2007
More information about the Python-list mailing list
Thu Oct 11 03:21:59 EDT 2007
- Previous message (by thread): Keeping track of subclasses and instances?
- Next message (by thread): Keeping track of subclasses and instances?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Steven D'Aprano <steve at REMOVE-THIS-cybersource.com.au> 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.
- Previous message (by thread): Keeping track of subclasses and instances?
- Next message (by thread): Keeping track of subclasses and instances?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list