{"categories":[{"label":"Python Modules","url":"https://skillfed.io/packages/category/software-development-libraries-python-modules/11"}],"enrichment":{"capability":"Provides a lightweight decorator-based system for defining single-dispatch generic functions that route calls based on the type or identity of their first argument.","skillfed_tags":["abandoned","legacy","dispatch"],"use_cases":["Implementing a visitor-like pattern where different object types need different handling without modifying the objects themselves.","Creating a simple type-based dispatch system for serialization, formatting, or conversion routines.","Building extensible functions where new type handlers can be registered at runtime without changing the core function.","Legacy codebases that already depend on simplegeneric and cannot easily migrate to functools.singledispatch."],"what_it_does":"simplegeneric is a minimal single-dispatch generic function library that lets you define functions that behave differently based on the type or identity of their first argument. You decorate a base function with @generic, then register type-specific or object-specific implementations using @func.when_type() or @func.when_object() decorators. When the function is called, it looks up and invokes the appropriate implementation based on the argument's type, falling back to the default if no match is found.\n\nThe library is intentionally simple\u2014under 100 lines of code with no dependencies\u2014and uses lookup tables similar to pickle.dump() and other standard library generic functions. It supports inheritance (methods defined for supertypes are inherited via MRO), multiple type/object registration in a single decorator, and inspection methods like has_type() and has_object(). However, it is abandoned (last release April 2012) and predates Python's built-in functools.singledispatch by several years.","worth_installing":"No. The package is abandoned (no maintenance since 2012) and its Python 3 support is undocumented and untested. Modern Python (3.4+) includes functools.singledispatch, which is actively maintained and serves the same purpose. The unclear license treatment and high install friction add further risk. Install only if you are maintaining legacy code that already depends on it and cannot migrate to functools.singledispatch."},"id":"simplegeneric","links":{"html":"https://skillfed.io/packages/simplegeneric","md":"https://skillfed.io/packages/simplegeneric.md","pypi":"https://pypi.org/project/simplegeneric/"},"maintenance":{"status":"abandoned"},"meta":{"latest_release":"2012-04-01","license_spdx":null,"license_treatment":"unclear","name":"simplegeneric","python_support":"unspecified","summary":"Simple generic functions (similar to Python's own len(), pickle.dump(), etc.)"},"popularity":{"monthly_downloads":561418,"position":5996,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.8.1"}
