This file contains hidden or 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
#!/usr/bin/env python | |
def curry(func): | |
""" | |
Decorator to curry a function, typical usage: | |
>>> @curry | |
... def foo(a, b, c): | |
... return a + b + c |
This file contains hidden or 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
""" | |
Python's set data structure is the only one without a literal | |
notation for an empty set. | |
http://excess.org/article/2012/11/python-container-literals/ | |
This is an ast transformer to add an empty set notation with the | |
following form: | |
empty_set = {_} |
This file contains hidden or 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
import datetime | |
from pprint import pprint | |
from django.db import models, signals | |
from django.utils import timezone | |
import django.dispatch | |