💥 Breaking changes: imports
Two major changes have been introduced:
- Imports are no longer at the top level but are now nested their respective modules
- For the 🐍 python implementation, the available imports have changed
python
from pipe_operator.elixir_flow import elixir_pipe, tap, then
from pipe_operator.python_flow import end, pipe, start, tap, task, then, wait
If you were using the python implementation before, the migration is quite simple. Here is the mapping:
| Before | After |
| ------------- | ------- |
| `PipeStart` | `start` |
| `Pipe` | `pipe` |
| `PipeArgs` | `pipe` |
| `Tap` | `tap` |
| `Then` | `then` |
| `ThreadPipe` | `task` |
| `ThreadWait` | `wait` |
| `PipeEnd` | `end` |
🚀 New feature: async function support
The 🐍 python implementation now support **async functions** from `asyncio`.
When using `pipe`, `tap`, or `task`, you can freely pass an async or sync function as the first argument.
As for `then`, it only supports single-arg lambda function.
🔧 Other changes
- ✨ [Python] Exported classes with aliases (ie `PipeStart` is exported as `start`) for improved readability
- 🔧 [Python] Updated documentation (docstrings and [README.md](./README.md))
- 🔧 [Python] `>>` logic is now handle in each pipeable's `__rrshift__` instead of `PipeObject.__rshift__`
- 🔧 [Python] Greatly improved typing annotations (using `overload`, `override`, `TypeAlias`, `TypeGuard`, ...)