Skip to content

TiagoCraft/indexable_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IndexableGenerator

Implement Sequence functionalities to python Generators.

These include getitem, index and length. Values are cached as they are consumed from the generator.

Examples:

@IndexableGenerator.cast
def gen():
    for x in range(10):
        yield x

ig = gen()
ig[3:6]  # (3, 4, 5)

ig = IndexableGenerator((x for x in range(10)))
ig[3:6]  # (3, 4, 5)

About

Implement Sequence functionalities to python Generators.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages