Пакет python3-module-backcall: Информация
Исходный пакет: python3-module-backcall
Версия: 0.2.0-alt2
Собран: 13 августа 2023 г. 14:54
Категория: Разработка/Python 3
Сообщить об ошибке в пакетеДомашняя страница: https://github.com/takluyver/backcall
Лицензия: BSD-3-Clause
О пакете: Specifications for callback functions passed in to an API
Описание:
Specifications for callback functions passed in to an API
If your code lets other people supply callback functions, it's important
to specify the function signature you expect,
and check that functions support that. Adding extra parameters later
would break other peoples code unless you're careful.
backcall provides a way of specifying the callback signature
using a prototype function:
from backcall import callback_prototype
@callback_prototype
def handle_ping(sender, delay=None):
pass
def register_ping_handler(callback):
callback = handle_ping.adapt(callback)
ping_callbacks.append(callback)
If the callback takes fewer parameters than your prototype,
backcall will wrap it in a function that discards the extra arguments.
If the callback expects more arguments,
a TypeError is thrown when it is registered.
For more details, see the docs or the Demo notebook.Сопровождающий: Stanislav Levin
Последнее изменение
10 ноября 2022 г. Stanislav Levin 0.2.0-alt2
- Fixed FTBFS (flit_core 3.7.1).
14 сентября 2020 г. Aleksei Nikiforov 0.2.0-alt1
- Initial build for ALT.