Christoph Zwerschke wrote: > Sorry. Your answer was good; I missed the point and thought you wrote > set(d.keys()). Is it documented anywhere that set(d) = set(d.keys())? I > think this should go into the Python Doco where keys() are explained.
It follows from what is documented. set(<iterable object>) creates a set that contains all elements in the iterable object: http://docs.python.org/lib/built-in-funcs.html#l2h-63 Now, is a dictionary an iterable object? Yes, it is: http://www.python.org/peps/pep-0234.html Together, this gives the property I demonstrated. Unfortunately, the PEP apparently hasn't made it into the implementation. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list