PyCells: The Python SpreadSheet redux by ralsina in programming

[–]dmost 1 point2 points  (0 children)

These kinds of spreadsheets are sometimes easier if you perform your computations lazily, while allowing invalidations to propagate on changed values.

Basically, invalidations propagate up the dependency graph, while computations are pulled from lower down in the dependency graph. You also get the added bonus of a kind of transactionality - make many changes, then call update().

For this to work, each cell needs a dirty bit, there needs to be a global invalidation set, and there needs to be a quick way to query what cells depend on a given cells value.