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.5.zip (90.2 kB view details)

Uploaded Source

generator_tools-0.3.5.tar.gz (87.8 kB view details)

Uploaded Source

Built Distributions

generator_tools-0.3.5.win32-py2.6.exe (161.2 kB view details)

Uploaded Source

generator_tools-0.3.5.win32-py2.5.exe (161.2 kB view details)

Uploaded Source

File details

Details for the file generator_tools-0.3.5.zip.

File metadata

File hashes

Hashes for generator_tools-0.3.5.zip
Algorithm Hash digest
SHA256 8ad073ae401b3a5afc9891c6163f15da9795dc05f974f86a51142dbacaba6ecc
MD5 24c0c06aa7ce7ba6220b12a1f8c1a918
BLAKE2b-256 b5a70382c822fabf73e28d07d329bf131fe6bd7eb1f6a42115371e5f47e10f23

See more details on using hashes here.

File details

Details for the file generator_tools-0.3.5.tar.gz.

File metadata

File hashes

Hashes for generator_tools-0.3.5.tar.gz
Algorithm Hash digest
SHA256 fd296e9a2ca1ab8f1a02ac8cd24d54349453db1b57a915b02f8e9ce5ca2720b5
MD5 5df9959b096fa418d3bb86464ed0673e
BLAKE2b-256 16c374b384735986ee5031cb9ccea0eac5ae45b5216a56828c27000f265de3a7

See more details on using hashes here.

File details

Details for the file generator_tools-0.3.5.win32-py2.6.exe.

File metadata

File hashes

Hashes for generator_tools-0.3.5.win32-py2.6.exe
Algorithm Hash digest
SHA256 51181a34f7d374513c4eb771eeb16dee33cea7be52b8f25b9a474f9b8afa66c0
MD5 b5e00f800f043581bc4877789eeb674d
BLAKE2b-256 3269b6640ac7a00904dbc840b0a17bf89adc431566297cf0b760e406934f3894

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for generator_tools-0.3.5.win32-py2.5.exe
Algorithm Hash digest
SHA256 061f9d7751697b6466207f4bf80969dda9ef5718be7bbf6f72207300b424b9c3
MD5 28f840c213f6427422c03cb0191572eb
BLAKE2b-256 25817f754cf17add37423bbb7e894729ff1218b29a40bb4682e86e865c6daaf9

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