I'm faint why this can't work

JStoneGT at aol.com JStoneGT at aol.com
Fri Feb 16 03:27:46 EST 2007


 
> Hello,
> 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.
The codes got by me from the book of "Dive into  Python".The original codes 
are  below:
 
class  FileInfo(dict):                  
"store file  metadata"
def __init__(self, filename=None): 
self["name"] = filename

It's in the chapter 5.5.

 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070216/2a538d67/attachment.html>


More information about the Python-list mailing list