On Feb 7, 12:28 am, grflanagan <[EMAIL PROTECTED]> wrote:
> On Feb 6, 11:07 pm, Amit Gupta <[EMAIL PROTECTED]> wrote:
>
> > Hi
>
> > How do I get user defined attributes of a class? e.g
>
> > Class A(object) :
> >   self.x = 1
> > ------------------
>
> > I want something like:
> >   for userattrib in A.getAllUserAttribute() :
> >     print userattrib
[..]
>
> HTH
>
> Gerard

Thanks. What I found is: If I call iterate over the __dict__ of the
instance of the class, I only get user-atttributes and not built-in
attributes. I have an instance of that class, anyway, so this will do.
However, I wonder if I am getting just lucky and this might change in
future. In that regard the solution provides by all posters above
might well be more robust.

A
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to