I'm faint why this can't work
Gabriel Genellina
gagsl-py at yahoo.com.ar
Fri Feb 16 05:08:32 EST 2007
En Fri, 16 Feb 2007 05:27:46 -0300, <JStoneGT at aol.com> 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
More information about the Python-list
mailing list