[Tutor] KeyError: 'DEFAULT'

Marc Tompkins marc.tompkins at gmail.com
Thu Feb 19 20:45:52 CET 2009


On Thu, Feb 19, 2009 at 11:34 AM, Isaac Eiland-Hall <daychilde at gmail.com>wrote:

>  http://python.pastebin.com/m26864a1b
>
>
>
> Traceback (most recent call last):
>
>                 File "./loopy", line 328, in <module>
>
>
> set[current_set][current_section][current_key] = current_value
>
> KeyError: 'DEFAULT'
>
One thing pops out at me - I'm not quite done reviewing yet, but...
Don't use reserved words as variable names!  "set" is a built-in type in
Python, and set() is a constructor for sets.
By doing this:

> set = {}
>
the best you can hope for is to confuse your fellow programmers - worse,
there may be some ambiguity at runtime.

-- 
www.fsrtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090219/7ad798db/attachment.htm>


More information about the Tutor mailing list