On Wed, May 25, 2011 at 3:10 AM, Octavian Rasnita <orasn...@gmail.com> wrote: >> Once again. Suppose we have array of key-value pairs (two-dimensional >> array), > > This is a forced example to fit the way Python can do it with a clean syntax, > but I don't think there are cases in which somebody wants to create > hashes/dictionaries where the key is not a plain string but an array. > > This is not a rare case, but a case that probably nobody needs, ever.
This is far more popular case than converting flat lists into dicts in Python world. In fact, I *never* had need to convert flat list instead of properly structured one. Thats why we have both lists and tuples, after all. Sure, since perl does not support it at all, perl programmers do not use it and resort to idea of "guess which values are keys by index" due to lack of better approach, with need of obscure "=>" pseudo-syntax to cover it up. -- With best regards, Daniel Kluev -- http://mail.python.org/mailman/listinfo/python-list