[Python-Dev] ConfigParser shootout, preliminary entry
Bob Ippolito
bob at redivi.com
Mon Oct 18 19:57:31 CEST 2004
On Oct 18, 2004, at 13:46, Josiah Carlson wrote:
>> Attributes may be 'generic' (untyped) or 'typed', and are stored in
>> the order they are declared in the class statement. The value provided
>> in the definition above is the 'default value'. Simple attributes may
>> also be provided, but won't be type checked or kept in the original
>> order. To read the ini file, just do this:
>
> I think the syntax looks good, but as per a thread in python-list, you
> cannot discover the order of class variables by any solution (metaclass
> or otherwise), due to the fact that they become part of the class
> dictionary; which is arbitrarily unordered.
>
> If ordering is important to a user, one could have an optional
> __order__
> attribute that gives the list of items in-order.
That's not quite true. TypedAttribute instances and iniSection's
__new__ could have serial numbers.
-bob
More information about the Python-Dev
mailing list