Comparison
methoddispatch vs simplegeneric vs singledispatch
Maintenance, adoption and momentum side by side, from PyPI, GitHub and deps.dev data refreshed every day.
singledispatch decorator for class methods.
Slowing down. Last release over 3 years ago, little activity since. Fine for existing code; think twice for a new project.
pip install methoddispatchSimple generic functions (similar to Python's own len(), pickle.dump(), etc.)
Deprecated. Its authors have deprecated it and no longer maintain it.
pip install simplegenericBackport functools.singledispatch to older Pythons.
Low maintenance activity. Last release 19 months ago, commits in 6 of the last 26 weeks. Weaker on recent releases and release cadence. It brings a standard-library module to older Pythons: on current versions, use the built-in one.
pip install singledispatchIn short
- methoddispatch is slowing down (last release over 3 years ago): fine for existing code, risky for a new project.
- simplegeneric is deprecated: avoid it for new projects.
- singledispatch is the most used: 1.5M downloads a month, 2.1× more than simplegeneric.
- singledispatch also has the best Pythie’s Index (38).
Side by side
| Metric | methoddispatch | simplegeneric | singledispatch |
|---|---|---|---|
| Pythie’s Index | Pythie’s Index: 24 | 6 |