Skip to content

Instantly share code, notes, and snippets.

@philipbjorge
philipbjorge / EmptySetLiteral.py
Last active March 2, 2016 12:10
Empty Set Literal Notation for Python - {_}
"""
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 = {_}