jwodder / interleave Goto Github PK
View Code? Open in Web Editor NEWYield from multiple iterators as values become available
License: MIT License
Yield from multiple iterators as values become available
License: MIT License
Implement this with a function named interleave_as_needed()
, lazy_interleave()
, or similar
submit()
variant submit_as_needed()
or lazy_submit()
Allowing users to submit iterators normally to this sort of interleaver seems likely to cause problems; it may be necessary to return a variant (LazyInterleaver
?) interleaver class (inheriting from a base class) that doesn't have public submit()
and finalize()
methods
Don't forget to handle errors raised while iterating over the super-iterator!
Collect all(?) errors and raise them at the end(?) of iteration in an ExceptionGroup
For Pythons prior to 3.11, use the exceptiongroup
package.
Only do this if a dedicated onerror
value is given?
Should this become the default behavior once 3.11 is the lowest supported Python?
Add a utility function (iterresults()
?) that converts an Iterator[T]
into Iterator[Result[T]]
so that all errors raised within iterators can be retrieved & inspected
Give shutdown()
the same option (defaulting to None
, indicating the value that interleave()
was called with)
Option name: put_after_stop
? stop_putting
? put_after_shutdown
? shutdown_put
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.