Skip to main content

Runtime method overload decorator to simulate C/C++ behavior of having multiple functions with the same name but different parameters.

Project description

strongtyping-pyoverload

Python 3.13 Python 3.14 Python application Python tox image Ruff AI Agents

Runtime method overloading for Python

strongtyping-pyoverload provides a powerful overload decorator that brings true runtime method overloading to Python, similar to C++.

Key Features

  • Native Pydantic Integration: Automatically validate and dispatch based on Pydantic models.
  • Deep Inheritance & Mixin Support: Respects Method Resolution Order (MRO) for complex class hierarchies.
  • AI-Ready Metadata: Sets __signature__ and __annotations__ for better IDE and AI assistant support.
  • High Performance: Optimized lookup logic with caching for minimal overhead.
  • Modern Python: Full support for typing.Annotated, keyword-only parameters, and Python 3.13+.

Quick Start

from strongtyping_pyoverload import overload

class DataProcessor:
    @overload
    def process(self, data: str):
        return data.upper()

    @overload
    def process(self, data: list):
        return [item * 2 for item in data]

Documentation

Full documentation can be found at readthedocs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

strongtyping_pyoverload-1.0.1.tar.gz (12.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

strongtyping_pyoverload-1.0.1-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file strongtyping_pyoverload-1.0.1.tar.gz.

File metadata

  • Download URL: strongtyping_pyoverload-1.0.1.tar.gz
  • Upload date:
  • Size: 12.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for strongtyping_pyoverload-1.0.1.tar.gz
Algorithm Hash digest
SHA256 058ffaba296b99a41c04af433554c3cf9f1353b8f4eb40d68f411205f7433273
MD5 0c3db6401bfd19470c197b5591d569b0
BLAKE2b-256 db5637e88d109da154876a54558d37966a2f09833a3de32c83588e2ca3258741

See more details on using hashes here.

Provenance

The following attestation bundles were made for strongtyping_pyoverload-1.0.1.tar.gz:

Publisher: python-publish.yml on FelixTheC/py-overload

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file strongtyping_pyoverload-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for strongtyping_pyoverload-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ea03145fdc3d2f14641eb960d6b8a6404e72362499b4ac156d743d4b76793fc6
MD5 312ae2b76f4b70f04baef8fad9657422
BLAKE2b-256 bded368ae10f365baa2b2d041dfd28831130a213503317c59e684b442b845b61

See more details on using hashes here.

Provenance

The following attestation bundles were made for strongtyping_pyoverload-1.0.1-py3-none-any.whl:

Publisher: python-publish.yml on FelixTheC/py-overload

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page