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
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
Release files for generator_tools 0.3.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distributions (sdists)
| File | Size | Uploaded | |
|---|---|---|---|
| generator_tools-0.3.6.zip | 90.3 kB | Details | |
| generator_tools-0.3.6.tar.gz | 87.9 kB | Details |
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| generator_tools-0.3.6.win32-py2.6.exe | Details | |||
| generator_tools-0.3.6.win32-py2.5.exe | Details |
Total release size: 500.8 kB
Release files / generator_tools-0.3.6.zip
| Download URL | generator_tools-0.3.6.zip |
|---|---|
| Size | 90.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2dfd4cb007996dfec296009f0fbc7e6a4d90bf84e6c2c3a83e8f6aaf88c6f6a8
|
|
BLAKE2b-256 checksum How to use checksums |
31c5c2010cb7a244ad127428478c3c35fc1187eaae2fa97418c9ad9caab66380
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / generator_tools-0.3.6.tar.gz
| Download URL | generator_tools-0.3.6.tar.gz |
|---|---|
| Size | 87.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bdda5d37f6205eb5c6e3ee06f8d54b005169311c5d8025fcd290ff90d5356869
|
|
BLAKE2b-256 checksum How to use checksums |
8e477b92da7702f6cef6377c0a7584736f4ad38bb1508859c313240e723329c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / generator_tools-0.3.6.win32-py2.6.exe
| Download URL | generator_tools-0.3.6.win32-py2.6.exe |
|---|---|
| Size | 161.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1ca31dfe23f060c36e26d7457660087e107af812ec24a2980629e00d7625293b
|
|
BLAKE2b-256 checksum How to use checksums |
0a51768cc64b353c9e2953ea9015a2c6da58199638cb82e23b9491324f8dc082
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / generator_tools-0.3.6.win32-py2.5.exe
| Download URL | generator_tools-0.3.6.win32-py2.5.exe |
|---|---|
| Size | 161.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
49d0c1fd77d5fed92fa2acd4845f2f61787dd5db735bdda634d48b20b27989e9
|
|
BLAKE2b-256 checksum How to use checksums |
02077ad63e384c123fba30157febb1c34338a6bedf038e1cf5a7351e053f9378
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |