# Generic programming library for Python
[](https://github.com/gaphor/generic/actions)
[](https://codeclimate.com/github/gaphor/generic/maintainability)
[](https://codeclimate.com/github/gaphor/generic/test_coverage)
[](https://generic.readthedocs.io/en/latest/?badge=latest)
[](https://app.element.io/#/room/#gaphor_Lobby:gitter.im)
[](https://securityscorecards.dev/viewer/?platform=github.com&org=gaphor&repo=generic)
Generic is a library for [Generic programming](https://en.wikipedia.org/wiki/Generic_programming), also known as [Multiple dispatch](https://en.wikipedia.org/wiki/Multiple_dispatch).
The Generic library supports:
* multi-dispatch: like `functools.singledispatch`, but for more than one parameter
* multi-methods: multi-dispatch, but for methods
* event dispatching: based on a hierarchical event structure (event objects)
You can read
[documentation](http://generic.readthedocs.org/en/latest/index.html) hosted at
excellent readthedocs.org project. Development takes place on
[github](http://github.com/gaphor/generic).
# Changes
## 1.1.3
- Dependency updates
## 1.1.2
- Replace print statements with logging
- Enable trusted publisher for PyPI
- Create Security Policy
- Update LICENSE to BSD 3-Clause
- Add support for Python 3.12
- Simplify build: drop tox
- Update documentation theme to Furo
- Switch linting to ruff
## 1.1.1
- Add support for Python 3.11
- Move mypy configuration to pyproject.toml
- Enable automatic release of new versions with CI
## 1.1.0
- Rename `master` branch to `main`
- `generic.event.Manager` executes all handlers and throws an `ExceptionGroup` in case of errors
## 1.0.1
- Add Support for Python 3.10, Drop Support for Python 3.7
- Enable Pre-commit Hooks for isort, toml, yaml, pyupgrade, docformatter, and flake8
- Migrate to GitHub Actions
## 1.0.0
- Updated documentation on [Readthedocs](https://generic.readthedocs.io)
- Fix `multimethod.otherwise` clause
## 1.0.0b1
- Ported the code to Python 3.7, Python 2 is no longer supported
- Multimethods now have their own module
- The interface now mimics `functools.singledispatch`:
- the `when` method has been renamed to `register`
- overriding of methods is no longer possible
## 0.3.1
- Minor fixes in distribution.
## 0.3
- Event management with event inheritance support.
## 0.2
- Methods with multidispatch by object type and positional arguments.
- Override multifunctions with ``override`` method.
## 0.1
- Registry with simple and type axes.
- Functions with multidispatch by positional arguments.
Raw data
{
"_id": null,
"home_page": "https://generic.readthedocs.io/",
"name": "generic",
"maintainer": "Arjan Molenaar",
"docs_url": "https://pythonhosted.org/generic/",
"requires_python": "<4.0,>=3.8",
"maintainer_email": "gaphor@gmail.com",
"keywords": "generic, multi dispatch, dispatch, event",
"author": "Andrey Popp",
"author_email": "8mayday@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/41/f1/dfb7255d7ce2b951acdeb3ab4067c4dbbee431fc6d1686a1e691d91e8c05/generic-1.1.3.tar.gz",
"platform": null,
"description": "# Generic programming library for Python\n\n[](https://github.com/gaphor/generic/actions)\n[](https://codeclimate.com/github/gaphor/generic/maintainability)\n[](https://codeclimate.com/github/gaphor/generic/test_coverage)\n[](https://generic.readthedocs.io/en/latest/?badge=latest)\n[](https://app.element.io/#/room/#gaphor_Lobby:gitter.im)\n[](https://securityscorecards.dev/viewer/?platform=github.com&org=gaphor&repo=generic)\n\nGeneric is a library for [Generic programming](https://en.wikipedia.org/wiki/Generic_programming), also known as [Multiple dispatch](https://en.wikipedia.org/wiki/Multiple_dispatch).\n\nThe Generic library supports:\n\n* multi-dispatch: like `functools.singledispatch`, but for more than one parameter\n* multi-methods: multi-dispatch, but for methods\n* event dispatching: based on a hierarchical event structure (event objects)\n\nYou can read\n[documentation](http://generic.readthedocs.org/en/latest/index.html) hosted at\nexcellent readthedocs.org project. Development takes place on\n[github](http://github.com/gaphor/generic).\n\n\n# Changes\n\n## 1.1.3\n\n- Dependency updates\n\n## 1.1.2\n\n- Replace print statements with logging\n- Enable trusted publisher for PyPI\n- Create Security Policy\n- Update LICENSE to BSD 3-Clause\n- Add support for Python 3.12\n- Simplify build: drop tox\n- Update documentation theme to Furo\n- Switch linting to ruff\n\n## 1.1.1\n\n- Add support for Python 3.11\n- Move mypy configuration to pyproject.toml\n- Enable automatic release of new versions with CI\n\n## 1.1.0\n\n- Rename `master` branch to `main`\n- `generic.event.Manager` executes all handlers and throws an `ExceptionGroup` in case of errors\n\n## 1.0.1\n\n- Add Support for Python 3.10, Drop Support for Python 3.7\n- Enable Pre-commit Hooks for isort, toml, yaml, pyupgrade, docformatter, and flake8\n- Migrate to GitHub Actions\n\n## 1.0.0\n\n- Updated documentation on [Readthedocs](https://generic.readthedocs.io)\n- Fix `multimethod.otherwise` clause\n\n## 1.0.0b1\n\n- Ported the code to Python 3.7, Python 2 is no longer supported\n- Multimethods now have their own module\n- The interface now mimics `functools.singledispatch`:\n - the `when` method has been renamed to `register`\n - overriding of methods is no longer possible\n\n## 0.3.1\n\n- Minor fixes in distribution.\n\n## 0.3\n\n- Event management with event inheritance support.\n\n## 0.2\n\n- Methods with multidispatch by object type and positional arguments.\n- Override multifunctions with ``override`` method.\n\n## 0.1\n\n- Registry with simple and type axes.\n- Functions with multidispatch by positional arguments.\n\n",
"bugtrack_url": null,
"license": "BSD License",
"summary": "Generic programming library for Python",
"version": "1.1.3",
"project_urls": {
"Documentation": "https://generic.readthedocs.io/",
"Homepage": "https://generic.readthedocs.io/",
"Repository": "https://github.com/gaphor/generic"
},
"split_keywords": [
"generic",
" multi dispatch",
" dispatch",
" event"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "7cfeb400a35aaa9d8aecf7dce0743665ebe31ecbe39eb1515e9206b57ff00e7c",
"md5": "cb910e5b34d76245c8287585008d5f70",
"sha256": "2959b6ecce3567c5d3b360b893fbac4c983335e5cb9d017e3ea28b5d060def01"
},
"downloads": -1,
"filename": "generic-1.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "cb910e5b34d76245c8287585008d5f70",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.8",
"size": 9940,
"upload_time": "2024-07-12T22:21:42",
"upload_time_iso_8601": "2024-07-12T22:21:42.350281Z",
"url": "https://files.pythonhosted.org/packages/7c/fe/b400a35aaa9d8aecf7dce0743665ebe31ecbe39eb1515e9206b57ff00e7c/generic-1.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "41f1dfb7255d7ce2b951acdeb3ab4067c4dbbee431fc6d1686a1e691d91e8c05",
"md5": "191eba9d059457819e19a29386162af4",
"sha256": "778f8246fd6e79c21d4b8b76ddc008df8b3f3dd20560d4177c006e4568f30944"
},
"downloads": -1,
"filename": "generic-1.1.3.tar.gz",
"has_sig": false,
"md5_digest": "191eba9d059457819e19a29386162af4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.8",
"size": 9568,
"upload_time": "2024-07-12T22:21:43",
"upload_time_iso_8601": "2024-07-12T22:21:43.725107Z",
"url": "https://files.pythonhosted.org/packages/41/f1/dfb7255d7ce2b951acdeb3ab4067c4dbbee431fc6d1686a1e691d91e8c05/generic-1.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-12 22:21:43",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gaphor",
"github_project": "generic",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "generic"
}