effect isolation in Python, to facilitate more purely functional code
The do_return
function which was previously used to support returning values from @do
functions is now deprecated. In Python 3, we can just use return
statements.
The very last bare-except:
clause was removed from the Effect library, meaning that KeyboardInterrupt and SystemExit should no longer be swallowed by effect performance.
This is a major backwards-incompatible release of Effect.
Everywhere that exc_info
tuples were previously used for exceptions, now we simply use Exception instances. exc_info
tuples were only necessary on Python 2, because Exception objects did not carry their tracebacks. Now, on Python 3, tracebacks are embedded in the Exception instance, so we don't need to worry about that old three-tuple.
This means that Effect 1.0 only supports Python 3 and up (officially, only 3.6 and up are supported).
Incompatible changes:
Features:
Thanks to @manishtomar who contributed the work for this release.
Features:
__eq__
, to make testing easier.effect.raise_
is a convenience function to raise an exception instance.effect.testing.noop
is lambda i: None
, and is intended to be used in perform_sequence
sequences.effect.perform_delay_with_sleep
is a new performer that performs Delay
intents by sleeping.perform_sequence
have more informative output.Features:
return
statement to return values from functions using @do
notation.Bug fixes:
@do
would not propagate StopIteration exceptions@sync_performer
-decorated functions from accepting keyword argumentsOther: