Re: type = "instance" instead of "dict"

2006-03-01 Thread Terry Reedy
"Steven D'Aprano" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Cruella DeVille wrote: > >> This is off topic, but if read the documentation is the answere to >> everything why do we need news groups? > > Because "read the documentation" is NOT the answer to > everything. However,

Re: type = "instance" instead of "dict"

2006-02-28 Thread Steven D'Aprano
Cruella DeVille wrote: > This is off topic, but if read the documentation is the answere to > everything why do we need news groups? Because "read the documentation" is NOT the answer to everything. However, it was the answer to your question. > The problem with the > documentation for Python

Re: type = "instance" instead of "dict"

2006-02-28 Thread James Stroud
Mel Wilson wrote: > James Stroud wrote: > >> Fredrik Lundh wrote: >> >>> James Stroud wrote: >>> >>> Perhaps you did not know that you can inheret directly from dict, which is the same as {}. For instance: class Dict({}): pass >> >> >> >> I must have been hallucinating.

Re: type = "instance" instead of "dict"

2006-02-28 Thread Mel Wilson
James Stroud wrote: > Fredrik Lundh wrote: > >> James Stroud wrote: >> >> >>> Perhaps you did not know that you can inheret directly from dict, which >>> is the same as {}. For instance: >>> >>> class Dict({}): >>> pass > > > I must have been hallucinating. I swear I did this before and it wor

Re: type = "instance" instead of "dict"

2006-02-28 Thread Cruella DeVille
This is off topic, but if read the documentation is the answere to everything why do we need news groups? The problem with the documentation for Python is that I can't find what I'm looking for (and I didn't even know what I was looking for either). And since every language is well documented... th

Re: type = "instance" instead of "dict"

2006-02-28 Thread James Stroud
Fredrik Lundh wrote: > James Stroud wrote: > > >>Perhaps you did not know that you can inheret directly from dict, which >>is the same as {}. For instance: >> >>class Dict({}): >> pass I must have been hallucinating. I swear I did this before and it worked just like class Dict(dict). Since it

Re: type = "instance" instead of "dict"

2006-02-27 Thread Fredrik Lundh
James Stroud wrote: > Perhaps you did not know that you can inheret directly from dict, which > is the same as {}. For instance: > > class Dict({}): >pass > > Is the same as > > class Dict(dict): >pass it is ? >>> class Dict({}): ... pass ... Traceback (most recent call last): File

Re: type = "instance" instead of "dict"

2006-02-27 Thread Steve Holden
James Stroud wrote: > Cruella DeVille wrote: > >>I'm trying to implement a bookmark-url program, which accepts user >>input and puts the strings in a dictionary. Somehow I'm not able to >>iterate myDictionary of type Dict{} >> >>When I write print type(myDictionary) I get that the type is >>"insta

Re: type = "instance" instead of "dict"

2006-02-27 Thread James Stroud
Cruella DeVille wrote: > I'm trying to implement a bookmark-url program, which accepts user > input and puts the strings in a dictionary. Somehow I'm not able to > iterate myDictionary of type Dict{} > > When I write print type(myDictionary) I get that the type is > "instance", which makes no sens

Re: type = "instance" instead of "dict"

2006-02-27 Thread Jonathan Gardner
You should probably spend a bit more time in the documentation reading things for yourself. Read http://www.python.org/doc/2.4.2/ref/types.html under "Class Instances" for your answer. -- http://mail.python.org/mailman/listinfo/python-list

Re: type = "instance" instead of "dict"

2006-02-27 Thread Steve Juranich
Cruella DeVille wrote: > I created a class Dict (not dict), but since it only complicates things > for me I implemented my program without it. > > when I wrote myDictionary = dictionary.__dict__.iteritems() it worked > better... > what does the __dict__ mean? This is something else entirely and

Re: type = "instance" instead of "dict"

2006-02-27 Thread Cruella DeVille
I created a class Dict (not dict), but since it only complicates things for me I implemented my program without it. when I wrote myDictionary = dictionary.__dict__.iteritems() it worked better... what does the __dict__ mean? -- http://mail.python.org/mailman/listinfo/python-list

Re: type = "instance" instead of "dict"

2006-02-27 Thread Kent Johnson
Cruella DeVille wrote: > So what you are saying is that my class Dict is a subclass of Dict, and > user defined dicts does not support iteration? I don't know what your class Dict is, I was guessing. The built-in is dict, not Dict. > > What I'm doing is that I want to write the content of a dict

Re: type = "instance" instead of "dict"

2006-02-27 Thread Cruella DeVille
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

Re: type = "instance" instead of "dict"

2006-02-27 Thread Kent Johnson
Cruella DeVille wrote: > I'm trying to implement a bookmark-url program, which accepts user > input and puts the strings in a dictionary. Somehow I'm not able to > iterate myDictionary of type Dict{} > > When I write print type(myDictionary) I get that the type is > "instance", which makes no sens

type = "instance" instead of "dict"

2006-02-27 Thread Cruella DeVille
I'm trying to implement a bookmark-url program, which accepts user input and puts the strings in a dictionary. Somehow I'm not able to iterate myDictionary of type Dict{} When I write print type(myDictionary) I get that the type is "instance", which makes no sense to me. What does that mean? Thank