En Fri, 16 Feb 2007 05:27:46 -0300, <[EMAIL PROTECTED]> escribió:

>> I got this similar  sample script from books:
>> $ cat sampdict.py
>>  #!/usr/bin/python
>> class  SampDict(dict):
>> def __init__(self,  filename=None):
>> self["name"] =  filename
>
>
>> Are you sure you copied it exactly as it  appears? Where did you find  
>> it?
> Thank you for the help,Gabriel.

Sorry, I was wrong. The code as it is (with the right indentation, of  
course) should work OK.
Maybe, you were playing in the interpreter, and you wrote some test class  
and called it "dict"? Inadvertedly hiding the dict builtin.
Try again, it must work...

> The codes got by me from the book of "Dive into  Python".The original

A good book!

-- 
Gabriel Genellina

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

Reply via email to