Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Why g.__dict__['z'] = -4 showing "AttributeError: 'dict' object has no attribute '__dict__'" error? [Closed]

By
samba
on 9/26/14, 7:26 AM 2,913 views

The Question has been closed for reason: off-topic or not relevant

by
Ludo - Neobis
on 09/29/2014 07:42:06

HI All,

i am learning python now, small python code

g={'1':56}
g.update({'2':36})
g.__dict__['z'] = -4
print g

giving error "AttributeError: 'dict' object has no attribute '__dict__'"

learning source http://en.wikibooks.org/wiki/Python_Programming/Classes

 

Samba, please post python-related questions on stack overflow and forums of the like. Keep this forum for Odoo/OpenERP related questions.

Ludo - Neobis
on 9/29/14, 7:41 AM
0
Anas ea
On 9/29/14, 7:14 AM

We can also access the members dictionary of a class using the __dict__ member of the class.

g in that course is a class not a dictionary 

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 9/26/14, 7:26 AM
Seen: 2913 times
Last updated: 3/16/15, 8:10 AM