type = "instance" instead of "dict"

Cruella DeVille siv.hansen at gmail.com
Mon Feb 27 15:39:06 EST 2006


So what you are saying is that my class Dict is a subclass of Dict, and
user defined dicts does not support iteration?

What I'm doing is that I want to write the content of a dictionary to a
file, and send the dictionary (favDict) as a parameter like this:
favDict = Dict() <-- my own class (or not?)
# put things in favDict (works fine)
fileToWrite.writeFile(favDict) # AttributeError: Dict instance has no
attribute 'itervalues'
where fileToWrite is a filepointer in write-mode

Can I send a dictionary as a parameter the way I do here?

And another issue: what does the "self" - thing mean? I'm familiar with
java and php (is it like the java  and php- this?)




More information about the Python-list mailing list