![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
.. image:: https://travis-ci.org/takluyver/backcall.png?branch=master :target: https://travis-ci.org/takluyver/backcall
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):
# Specify positional parameters without a default, and keyword
# parameters with a default.
pass
def register_ping_handler(callback):
# This checks and adapts the function passed in:
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 <http://backcall.readthedocs.org/en/latest/>
_ or
the Demo notebook <http://nbviewer.ipython.org/github/takluyver/backcall/blob/master/Demo.ipynb>
_.
The tests are run with pytest <http://pytest.org/latest/>
_. In the root directory,
execute::
py.test
FAQs
Specifications for callback functions passed in to an API
We found that backcall demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.