[Tutor] listing classes

Kent Johnson kent37 at tds.net
Thu May 22 02:47:19 CEST 2008


On Wed, May 21, 2008 at 7:45 PM, Laureano Arcanio
<listas.condhor at gmail.com> wrote:
>
> I'm using the dir() function, but this give me an alphabetic ordered list,
> is there any way to do the same but getting an appearance ordered list ?.

Not easily. Attributes are stored in a dict; dicts don't preserve
order. You would have to make a custom metaclass that remembered the
order.

What is it you are trying to accomplish?

Kent


More information about the Tutor mailing list