On Thu, Feb 6, 2014 at 9:59 AM, Jose A. Lopes <[email protected]> wrote:
> Shouldn't this be?
>   keys.extend(dictionary.keys())

In Python, iterating over a dictionary iterates over its keys. :)

>>> a = {1:1, 2:2, 4:4}
>>> b = []
>>> b.extend(a)
>>> b
[1, 2, 4]

That said, if you think this is sufficiently non-obvious, your
suggestion works as well.

-- 
Raffa Santi
Google Germany GmbH
Dienerstr. 12
80331 München


Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschäftsführer: Graham Law, Christine Elizabeth Flores

Reply via email to