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.2.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.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: strongtyping_pyoverload-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 a3d21175c5186c7f371e551890a0386936adde2a5d1a1f25d9a17d4cd9937668
MD5 445ada6d9c2010439d6eb71aa199cf49
BLAKE2b-256 4f86334f1c21aadc4592ee2998cba4c3dc45268ed54d4dfd3aa737f8229f6550

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for strongtyping_pyoverload-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c3eaf754a7b61a34995c5d636621b0688a1925b875d079512b94fb6cc773c0c
MD5 f164e5ba74360d535551ddc7973a7be8
BLAKE2b-256 051e5d089de72dc828f535e0dfbaf7b9d584b92c3d78f70ee7b6fcde92bb70b4

See more details on using hashes here.

Provenance

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