> assert[key for key in required if key in params.keys()]
...
> Could you explain why it doesn't work and do you have any idea of how it 
> could work ?

Well, here, if any of the items are found, you get a list that is
non-False'ish, so the assert passes.

It sounds like you want all() (available as of 2.5)

  assert all(key in params for key in required)

This is modulo any key normalization for "From" vs. "FROM" vs.
"from", etc; but should be enough to pass your initial requirements.

-tkc


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

Reply via email to