"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,
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
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.
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
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
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
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
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
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
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
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
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
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
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
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
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
16 matches
Mail list logo