Skip to content

Instantly share code, notes, and snippets.

@aliles
aliles / namedtuple.py
Created August 21, 2011 12:06
Implementation of collections.namedtuple without using exec.
"collections.namedtuple implementation without using exec."
from collections import OrderedDict
from keyword import iskeyword
from operator import itemgetter
import itertools
import sys
__all__ = ['NamedTuple', 'namedtuple']