{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/5"}],"enrichment":{"capability":"Multimethod provides a decorator for adding multiple argument dispatching to functions, allowing you to define different implementations based on argument types with type-cached lookup.","skillfed_tags":["dispatch","generic-functions","type-routing"],"use_cases":["Implement mathematical operations that behave differently for int vs float arguments without explicit type checking.","Build serializers that handle different data types (dict, list, custom objects) with specialized logic per type.","Create API handlers that dispatch to different implementations based on request payload type.","Define recursive algorithms where base cases and recursive cases are separated by argument type.","Extend third-party classes with new methods by registering multimethod implementations across inheritance hierarchies."],"what_it_does":"Multimethod is a pure Python library that adds multiple argument dispatching to functions through a decorator. It lets you define multiple implementations of the same function name, each handling different argument type combinations. When called, the library inspects argument types and routes to the matching implementation\u2014or the closest match if an exact one isn't registered. It caches type lookups for speed and supports both simple type dispatch (using issubclass) and advanced generic types like Mapping, tuple, Iterable, and Callable with variance rules.\n\nThe library aims for simplicity and speed, offering two main modes: multimethod for faster cached positional-only dispatch, and multidispatch for compatibility with functools.singledispatch that also handles keyword arguments. It works with class methods, static methods, and custom metaclasses, and includes a subtype utility for isinstance and issubclass checks on generic types. No external dependencies are required.","worth_installing":"Yes. Multimethod is actively maintained, has no dependencies, supports modern Python versions (3.11+), carries a permissive license, and solves a real problem\u2014type-based function dispatch\u2014with a clean API and documented performance trade-offs. It's suitable for production use."},"id":"multimethod","links":{"html":"https://skillfed.io/packages/multimethod","md":"https://skillfed.io/packages/multimethod.md","pypi":"https://pypi.org/project/multimethod/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-07-29","license_spdx":"Apache-2.0","license_treatment":"permissive","name":"multimethod","python_support":"supports_current","summary":"Multiple argument dispatching."},"popularity":{"monthly_downloads":4117958,"position":2377,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"2.1"}
