Skip to main content

generator_tools enable copying and pickling generators

Project description

The generator tools package enables copying and pickling running generators in
CPython ( you don't need Stackless Python ).

Usage
-----

from generator_tools.copygenerators import*
from generator_tools.picklegenerators import*

def f(start):
i = start
while i<start+10:
yield i
i+=1

>>> f_gen = f(5)
>>> f_gen.next() # or next(f_gen) in Python 3.0
5
>>> f_gen.next()
6
>>> g_gen = copy_generator(f_gen)
>>> h_gen = copy_generator(f_gen)
>>> g_gen.next()
7
>>> h_gen.next()
7
>>> pickler = GeneratorPickler("test.pkl")
>>> pickler.pickle_generator(g_gen)
>>> k_gen = pickler.unpickle_generator()
>>> list(g_gen) == list(k_gen)
True

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

generator_tools-0.3-py2.5.zip (84.4 kB view details)

Uploaded Source

generator_tools-0.3-py2.5.tgz (81.9 kB view details)

Uploaded Source

Built Distribution

generator_tools-0.3.win32-py2.5.exe (168.1 kB view details)

Uploaded Source

File details

Details for the file generator_tools-0.3-py2.5.zip.

File metadata

File hashes

Hashes for generator_tools-0.3-py2.5.zip
Algorithm Hash digest
SHA256 3ea6cb81182f82853cef1809380d558de67275c1b79fe5441820b9a15e37d806
MD5 b9aa49ec57207949045d84e1fce4fc1f
BLAKE2b-256 f8c53cbfdeff5d61d4615b76e07fc453eb4813c9a59a9e19133ff0fad104ccd4

See more details on using hashes here.

File details

Details for the file generator_tools-0.3-py2.5.tgz.

File metadata

File hashes

Hashes for generator_tools-0.3-py2.5.tgz
Algorithm Hash digest
SHA256 8070109d973683e4cf7e7948d7cbed85b3e2b4192d73632bfa5eb2b60bbcbed3
MD5 e4684df07dd60d93abaffb677258d90d
BLAKE2b-256 31f576b1e1df1e3b132cd60358f0b99a1dd83342ad596915b7593fcfd535d347

See more details on using hashes here.

File details

Details for the file generator_tools-0.3.win32-py2.5.exe.

File metadata

File hashes

Hashes for generator_tools-0.3.win32-py2.5.exe
Algorithm Hash digest
SHA256 4a8d4aef5af20fb38cdfdb8646f4bb49762e6e779a669ef5ecc46799c0843a84
MD5 eda2be91e0c791c2ce7a2f03b246052e
BLAKE2b-256 28fdaf642a51fa26fe5e7060d0c0af77332e1c59394abc9ac0b9f0dd63390f44

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page