problems with dict() in python 2.2

Olaf Meyer nomail at nospam.net
Tue Jan 13 04:56:40 EST 2004


I'm trying to build a dictionary using python's dict type, but somehow 
it does not work the way I expect it to. Here's the code:

Python 2.2.1 (#7, Jan  9 2004, 16:59:31) [C] on hp-ux11
Type "help", "copyright", "credits" or "license" for more information.
 >>> data=dict(red=1)
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: 'red' is an invalid keyword argument for this function

What am I doing wrong?

Thanks,
   Olaf



More information about the Python-list mailing list