Created
May 22, 2024 07:20
-
-
Save 2tony2/9a0f0ff577e8bcab2215ac92a548918e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections.abc import Callable, Awaitable | |
| # Function with callable parameter | |
| def feeder(get_next_item: Callable[[], str]) -> None: | |
| ... # Body | |
| # Function with multiple callable parameters | |
| def async_query(on_success: Callable[[int], None], | |
| on_error: Callable[[int, Exception], None]) -> None: | |
| ... # Body | |
| # Async function example | |
| async def on_update(value: str) -> None: | |
| ... # Body | |
| callback: Callable[[str], Awaitable[None]] = on_update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment