Skip to main content

overloading is a module that provides function and method dispatching based on the types and number of runtime arguments.

When an overloaded function is invoked, the dispatcher compares the supplied arguments to available signatures and calls the implementation providing the most accurate match:

@overload
def biggest(items: Iterable[int]):
    return max(items)

@overload
def biggest(items: Iterable[str]):
    return max(items, key=len)
>>> biggest([2, 0, 15, 8, 7])
15
>>> biggest(['a', 'abc', 'bc'])
'abc'

Features

  • Function validation during registration and comprehensive resolution rules guarantee a well-defined outcome at invocation time.

  • Supports the typing module introduced in Python 3.5.

  • Supports optional parameters.

  • Supports variadic signatures (*args and **kwargs).

  • Supports class-/staticmethods.

  • Evaluates both positional and keyword arguments.

  • No dependencies beyond the standard library

Documentation

The full documentation is available at https://overloading.readthedocs.org/.

Metadata

Release files for OverloadingFixed 1.11

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

Source distribution (sdist)

Source distribution for OverloadingFixed 1.11
File Size Uploaded
OverloadingFixed-1.11.tar.gz 11.7 kB Details

Built distribution (wheel)

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

Total release size: 25.9 kB

Release files / OverloadingFixed-1.11.tar.gz

Download URL OverloadingFixed-1.11.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
cfde14d00f1f6ac9723a117072a1b2b7633e07beffb132181329d53aa1be44b2
BLAKE2b-256 checksum
How to use checksums
aefe01f17c498f5d026393bd4cdd78b7a6108150e666dd68c157a4bb38b92aed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release files / OverloadingFixed-1.11-py3-none-any.whl

Download URL OverloadingFixed-1.11-py3-none-any.whl
Size 14.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b453b794e6a8c5e1bfa49a4c4c8c016e63240f0616b319869e2e5360d505bd23
BLAKE2b-256 checksum
How to use checksums
c21587a57cbaac6ce0ca559302c5592875d4041799fafb00be1f19c37e4b7482
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/53.0.0 requests-toolbelt/0.9.1 tqdm/4.56.2 CPython/3.9.1

Release history Release notifications | RSS feed

This release

1.11 This release

2 release files

1.1

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0

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