This file contains 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
# Go-style enums in Python | |
# | |
# Implementation is here, scroll down for usage. | |
# | |
import operator | |
class LazyValue(object): | |
def __init__(self, value): |
This file contains 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
// 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[], |