26 ms·
As said in another comment, this seem to be a bit redundant with the readily available namedtuple. Moreover, it has dependencies with dorkitude_utils and pytho
by gbog 15y ago
As said in another comment, this seem to be a bit redundant with the readily available namedtuple.
Moreover, it has dependencies with dorkitude_utils and python_memoize, both of them I don't have in my python install.
- dorkitude 15y agoNamedtuple is a very useful module, but it doesn't enforce typing. Furthermore, it doesn't expose extensible classes, unless you want to write the sort of code you see when you pass `verbose=True` into the namedtuple constructor (http://drktd.com/C4QF http://drktd.com/C4QF). So while a game's BaseBuilding may require the "x", "y", and "building_type_id" fields, your FarmVille Plant may add "planted_time" in it's schema, plus a "harvestable_after_time" computed property. In the abstract, tuples simply arent suites to all problems (any more than are dicts): order doesn't always matter, and immutability certainly is not always desired. (As for those dependencies, they're submoduled in the repo: try `git clone --recursive`)
- deleted 15y ago[deleted]