Skip to main content

SmartCall

Last release Python version Documentation Test status Test coverage Last commit

This library provides a way to call functions that won't necessarily accept all of the arguments that you could pass to them. This situation often occurs when writing libraries that accept callback functions. The library might have lots of information that it could pass to callbacks, but not every callback will want every piece of information.

The following snippet shows how the library works. As an example, we'll invoke a callback with one required positional argument and two optional keyword arguments. Note that the callback only accepts the first keyword argument:

>>> from smartcall import call, PosOnly, KwOnly
>>> def my_callback(a, b):
...     return a, b
...
>>> call(
...     my_callback,
...
...     # This argument is required, so if the callback can't accept it, an
...     # error will be raised.
...     PosOnly(1, required=True), KwOnly('b', 2))
...
...     # These arguments are not required, so they will only be passed to the
...     # callback if it has a compatible signature.
...     KwOnly(b=2),
...     KwOnly(c=3),
... )
(1, 2)

Refer to the online documentation for more information.

Metadata

Release files for smartcall 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for smartcall 0.1.0
File Size Uploaded
smartcall-0.1.0.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for smartcall 0.1.0
File Interpreter ABI Platform
smartcall-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / smartcall-0.1.0.tar.gz

Download URL smartcall-0.1.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
440599751a67cf73f984eb9f7eab82d3064a893e9e1fdcd93a4af3ae5c37288e
BLAKE2b-256 checksum
How to use checksums
d45e830712b818df09ffb2cbc5d4a98868141d8d71a0628d81ae1aaced0b0014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 4, 2025.

Transparency log

Release files / smartcall-0.1.0-py3-none-any.whl

Download URL smartcall-0.1.0-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
af88462179e79593750339e2b6d5200319b8ad56817bc66a39638386a160b5c6
BLAKE2b-256 checksum
How to use checksums
3c314b117162911683876ec9be1e66e5969c10423ff377ebd78f55c1922ab1e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 4, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page