I'm faint why this can't work

Ben Finney bignose+hates-spam at benfinney.id.au
Fri Feb 16 05:51:24 EST 2007


JStoneGT at aol.com writes:

> 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

You've put the lines of code in your message without indentation.

Please remember that Python uses indentation syntactically. If you're
showing code examples in your message, you must make sure that the
indentation survives correctly.

The best way to do that is to use only tabs, *or* only spaces, for
indentation; many programs will mangle tabs in different ways, so
spaces are usually safest.

-- 
 \       "My aunt gave me a walkie-talkie for my birthday. She says if |
  `\     I'm good, she'll give me the other one next year."  -- Steven |
_o__)                                                           Wright |
Ben Finney




More information about the Python-list mailing list