Chris Angelico <ros...@gmail.com> writes:

> Sounds like a set operation to me.
>
> expected = {"foo", "bar", "spam"}
> missing = expected - set(json)

That works (because iterating a dict returns its keys). But it is less
immediately understandable, IMO, than this::

    expected = {"foo", "bar", "spam"}
    missing = expected - set(json.keys())

-- 
 \             “The greater the artist, the greater the doubt; perfect |
  `\       confidence is granted to the less talented as a consolation |
_o__)                                           prize.” —Robert Hughes |
Ben Finney

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to