Jim Jewett wrote: > On 4/27/07, Barry Warsaw <[EMAIL PROTECTED]> wrote: > > > - - Attributes. Interfaces allow you to make assertions about > > attributes, not just methods, while ABCs necessarily cover only methods. > > Why can't they have data attributes as well?
I agree with Jim. It seems to me that documenting standard attributes of a type is one thing that ABC's should be able to do. Perhaps a "@abstractattribute" decorator of some sort? Perhaps a class decorator "@attributes(name1, name2, ...)"? Attributes with those names would be automatically added to an instance, initialized to None, before the first __init__ method would be called. Bill _______________________________________________ Python-3000 mailing list [email protected] http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com
