Most Pythonic way to store (small) configuration

Rustom Mody rustompmody at gmail.com
Thu Aug 6 03:06:54 CEST 2015


On Thursday, August 6, 2015 at 6:32:03 AM UTC+5:30, Rustom Mody wrote:

> By contrast here is a more friendly error message (had put a comma where a colon
> required)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/usr/lib/python3.4/ast.py", line 46, in literal_eval
>     node_or_string = parse(node_or_string, mode='eval')
>   File "/usr/lib/python3.4/ast.py", line 35, in parse
>     return compile(source, filename, mode, PyCF_ONLY_AST)
>   File "<unknown>", line 2
>     "i", 1}

Uh...
The more helpfulness not evident as the most crucial line not cut-pasted

Heres the full bt

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/ast.py", line 46, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/lib/python3.4/ast.py", line 35, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 2
    "i", 1}
       ^
SyntaxError: invalid syntax


More information about the Python-list mailing list