Last active
April 18, 2016 12:24
-
-
Save tinnet/a8e8f6055aaae9c4713dabc7863b01bf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
instance = {'_id': 'Eom0boo1iroo'} | |
if any(map(lambda hit: hit['_id'] != instance['_id'], hits)): | |
yield ValidationError( | |
'unique property {} conflicts with existing object: {}'.format(_ref, hit) | |
) | |
# vs. | |
for hit in hits: | |
if hit['_id'] != instance['_id']: | |
yield ValidationError( | |
'unique property {} conflicts with existing object: {}'.format(_ref, hit) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment