Re: Getting an objetcs dict?

2008-09-02 Thread alex23
On Sep 2, 4:31 am, ssecorp [EMAIL PROTECTED] wrote:
 X.__dict__() and ngot a dict of its variables.

 Now i get errors doing this. what am i doing wrong?

The immediate problem is you're not reading the error messages.

 X.__dict__()
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: 'dict' object is not callable

The not callable is the big tip-off. As it states, __dict__ is a
dictionary object, -not- a method of your class.

 X.__dict__
{'__module__': '__main__', '__doc__': None}

The larger problem is you're not reading the docs  are using this
list to teach you Python. Are you aware of the python-tutor list?

http://mail.python.org/mailman/listinfo/tutor

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


Getting an objetcs dict?

2008-09-01 Thread ssecorp
I did nce(I think).

class X

X.__dict__() and ngot a dict of its variables.

Now i get errors doing this. what am i doing wrong?
--
http://mail.python.org/mailman/listinfo/python-list


Re: Getting an objetcs dict?

2008-09-01 Thread Wojtek Walczak
On Mon, 1 Sep 2008 11:31:42 -0700 (PDT), ssecorp wrote:
 I did nce(I think).

 class X

 X.__dict__() and ngot a dict of its variables.

 Now i get errors doing this. what am i doing wrong?

You're not asking smart questions:
http://www.catb.org/~esr/faqs/smart-questions.html

HINT: the attribute you're accessing is not a callable.

-- 
Regards,
Wojtek Walczak,
http://tosh.pl/gminick/
--
http://mail.python.org/mailman/listinfo/python-list


Re: Getting an objetcs dict?

2008-09-01 Thread Bruno Desthuilliers

ssecorp a écrit :

I did nce  (I think).
class X

X.__dict__() and ngot a dict of its variables.
Now i get errors doing this. what am i doing wrong?


cf Wojtek's answer.
--
http://mail.python.org/mailman/listinfo/python-list