Skip to content

Instantly share code, notes, and snippets.

# Go-style enums in Python
#
# Implementation is here, scroll down for usage.
#
import operator
class LazyValue(object):
def __init__(self, value):
@flowblok
flowblok / gist:3883065
Created October 13, 2012 03:10 — forked from harrisony/gist:3877260
Awesome hacky code!
// I've left parameters as-is, but success / failure might be constants?
// (if so, hash define them)
// also, I would usually pass in the records directly, rather than using
// global variables:
// Record *records,
// size_t n_records,
//
void list_generator(
int (*process)(Record, string[]),
string options[],