Skip to content

Instantly share code, notes, and snippets.

View brutasse's full-sized avatar
🤌

Bruno Renié brutasse

🤌
View GitHub Profile
@nvie
nvie / sift.py
Last active December 18, 2015 15:28
The sift itertool.
from collections import deque
from functools import wraps
def inversify(predicate):
"""Returns a predicate that is the inverses of the given predicate."""
@wraps(predicate)
def _inner(*args, **kwargs):
return not predicate(*args, **kwargs)
return _inner