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.0.tar.gz (12.3 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.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strongtyping_pyoverload-1.0.0.tar.gz
  • Upload date:
  • Size: 12.3 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.0.tar.gz
Algorithm Hash digest
SHA256 91dc2b913e8ba6ab8c646ab81e356ddec5ab961139260aa9cb9f717c718b3508
MD5 b5466b067c8aab0d1d9a0a9aff9d6b1b
BLAKE2b-256 8d37677971ecbaa780e1ddbc5fbbb58811703294d1a5c1c14db79fb78ba7bc40

See more details on using hashes here.

Provenance

The following attestation bundles were made for strongtyping_pyoverload-1.0.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for strongtyping_pyoverload-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f2d1909a211ee67ffdaa3205c37eb058161b5c4a880dc6a0ef6f6322f17b87dc
MD5 17f0f5edc9e23838c3c59a29d71030fd
BLAKE2b-256 0d5a7556e9be7191310598adf605195ce451b33311873b817ff9798a8ece3f30

See more details on using hashes here.

Provenance

The following attestation bundles were made for strongtyping_pyoverload-1.0.0-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