Pat schrieb:
I know it's not "fair" to compare language features, but it seems to me (a Python newbie) that appending a new key/value to a dict in Python is awfully cumbersome.In Python, this is the best code I could come up with for adding a new key, value to a dictmytable.setdefault( k, [] ).append( v ) In Perl, the code looks like this: $h{ $key } = $value ;
Whats wrong with: mytable[key] = value cheers Paul -- http://mail.python.org/mailman/listinfo/python-list