A context manager that creates savepoints, avoiding recalculating expensive parts of the code.
An example:
from savepoint import SavePoint
a = 10
b = 20
# do some expensive calculation here
with SavePoint("stuff.p"):
print "doing stuff"
a += 10
c = 30
print a, b, c
The first time the code is ran the with block is executed, and the modifed scope is pickled to stuff.p. Subsequent calls will update the global scope from the pickle file, and skip the block completely.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
savepoint-0.1.tar.gz
(2.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
savepoint-0.1-py2.7.egg
(2.9 kB
view details)
File details
Details for the file savepoint-0.1.tar.gz.
File metadata
- Download URL: savepoint-0.1.tar.gz
- Upload date:
- Size: 2.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
951b540d1326e19e7cda3d8b3b432e488f2259684a32411c887cac3a0c72e8a1
|
|
| MD5 |
838d9d7bf76ce3ac4094ddfb56ae198c
|
|
| BLAKE2b-256 |
ab1de0a0aab518476349815a93f80e9615bc98e1818f874641213ab9f3e4fea2
|
File details
Details for the file savepoint-0.1-py2.7.egg.
File metadata
- Download URL: savepoint-0.1-py2.7.egg
- Upload date:
- Size: 2.9 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a935c474027f9ffc1093376dfd32d33bc8042cace532e80e345729e5e05410b
|
|
| MD5 |
b6de6bb84ea96e060f06b0496f2079a8
|
|
| BLAKE2b-256 |
649bd7bdf5831d16d1bc398b3f52a2453b174f979f6b89c2ade2d84f36726a16
|