Giter VIP home page Giter VIP logo

undone's Introduction

undone

Version: 0.2

Three implementations

This module offers three undo stack implementations. Each has different tradeoffs, and may be better suited to a given situation than the others.

1. ReversibleUndoStack: reversible operations

  • define a class (or named tuple) for each operation, with "do" and "undo" methods
  • hand instances of these classes to the stack object
  • doesn't require any handle on the object(s) being modified by the operations
  • up to the user to ensure reversibility, which in some cases can be quite difficult
  • least memory and runtime overhead for operations

2. RegeneratingUndoStack: regenerating current state from scratch

  • define a callable object for each operation
  • hand instances of these objects to the stack object
  • requires a handle on or snapshot of the initial state of the object(s) being modified by the operations; operations must accept this handle as a parameter when called
  • higher overhead, especially for undo operation

3. SnapshotUndoStack: state-oriented

  • requires handles on or snapshots of incremental states of the object(s) being modified. These snapshots are triggered explicitly by the user, and may be taken as frequently or rarely as desired
  • can involve significant memory overhead in the worst case

Installation

undone works under Python 2.7 and Python 3.3+.

To install:

$ git clone http://github.com/gfetterman/undone.git
$ cd undone
$ pip install .

# to run the tests
$ pytest -v

Usage

(Coming soon.)

undone's People

Contributors

gfetterman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.