Re: getting all user defined attributes of a class

2008-02-07 Thread George Sakkis
On Feb 7, 1:42 pm, Amit Gupta <[EMAIL PROTECTED]> wrote: > 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

Re: getting all user defined attributes of a class

2008-02-07 Thread Amit Gupta
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

Re: getting all user defined attributes of a class

2008-02-07 Thread grflanagan
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 > class Meta(type):

Re: getting all user defined attributes of a class

2008-02-06 Thread Marc 'BlackJack' Rintsch
On Wed, 06 Feb 2008 15:16:26 -0800, Amit Gupta wrote: > On Feb 6, 2:55 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> Amit Gupta schrieb: >> > I should make class A as: >> > class A (object) : >> > x = 1 >> >> > Now, x is class attribute and I am looking for some-way to filter non- >> > us

Re: getting all user defined attributes of a class

2008-02-06 Thread Amit Gupta
On Feb 6, 2:55 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Amit Gupta schrieb: > > > > > On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > >> On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: > >>> Class A(object) : > >>> self.x = 1 > >> This is not valid Python

Re: getting all user defined attributes of a class

2008-02-06 Thread Diez B. Roggisch
Amit Gupta schrieb: > On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: >>> Class A(object) : >>> self.x = 1 >> This is not valid Python code. >> >>> I want something like: >>> for userattrib in A.getAllUserAttribute(

Re: getting all user defined attributes of a class

2008-02-06 Thread Amit Gupta
On Feb 6, 2:15 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: > > Class A(object) : > > self.x = 1 > > This is not valid Python code. > > > I want something like: > > for userattrib in A.getAllUserAttribute() : > > print usera

Re: getting all user defined attributes of a class

2008-02-06 Thread Marc 'BlackJack' Rintsch
On Wed, 06 Feb 2008 14:07:23 -0800, Amit Gupta wrote: > Class A(object) : > self.x = 1 This is not valid Python code. > I want something like: > for userattrib in A.getAllUserAttribute() : > print userattrib > > My question is, is there a builtin function, called > getAllUserAttributes?