# Generic programming library for Python
[![Build state](https://github.com/gaphor/generic/workflows/build/badge.svg)](https://github.com/gaphor/generic/actions)
[![Maintainability](https://api.codeclimate.com/v1/badges/c7be2d28400687b1375a/maintainability)](https://codeclimate.com/github/gaphor/generic/maintainability)
[![Test Coverage](https://api.codeclimate.com/v1/badges/c7be2d28400687b1375a/test_coverage)](https://codeclimate.com/github/gaphor/generic/test_coverage)
[![Documentation Status](https://readthedocs.org/projects/generic/badge/?version=latest)](https://generic.readthedocs.io/en/latest/?badge=latest)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/Gaphor/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
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.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": ">=3.8,<4.0",
"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/6e/10/5a973294613f0ab1f4d0703ecbfd7136665f9f041ac9306226877f846048/generic-1.1.2.tar.gz",
"platform": null,
"description": "# Generic programming library for Python\n\n[![Build state](https://github.com/gaphor/generic/workflows/build/badge.svg)](https://github.com/gaphor/generic/actions)\n[![Maintainability](https://api.codeclimate.com/v1/badges/c7be2d28400687b1375a/maintainability)](https://codeclimate.com/github/gaphor/generic/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/c7be2d28400687b1375a/test_coverage)](https://codeclimate.com/github/gaphor/generic/test_coverage)\n[![Documentation Status](https://readthedocs.org/projects/generic/badge/?version=latest)](https://generic.readthedocs.io/en/latest/?badge=latest)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![Gitter](https://img.shields.io/gitter/room/nwjs/nw.js.svg)](https://gitter.im/Gaphor/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\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.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.2",
"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": "53767bd456e58fc800d2209b7d3d5e07a35da215b9bd79530e427d645b014ce5",
"md5": "3017e9864faf1249fcc756188a007ffa",
"sha256": "05ab64121496a31eb56882df64347841d7e7cd65bff9f7b12576ee14f6bd5ae2"
},
"downloads": -1,
"filename": "generic-1.1.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3017e9864faf1249fcc756188a007ffa",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8,<4.0",
"size": 9904,
"upload_time": "2023-07-16T11:38:13",
"upload_time_iso_8601": "2023-07-16T11:38:13.381622Z",
"url": "https://files.pythonhosted.org/packages/53/76/7bd456e58fc800d2209b7d3d5e07a35da215b9bd79530e427d645b014ce5/generic-1.1.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "6e105a973294613f0ab1f4d0703ecbfd7136665f9f041ac9306226877f846048",
"md5": "ee4e408c3f098d1a7f24e70c0eb6ab5c",
"sha256": "35f52f9a450801d9be519aa60568743194d588b25291e4689cf3529d577e45b0"
},
"downloads": -1,
"filename": "generic-1.1.2.tar.gz",
"has_sig": false,
"md5_digest": "ee4e408c3f098d1a7f24e70c0eb6ab5c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8,<4.0",
"size": 9516,
"upload_time": "2023-07-16T11:38:14",
"upload_time_iso_8601": "2023-07-16T11:38:14.524673Z",
"url": "https://files.pythonhosted.org/packages/6e/10/5a973294613f0ab1f4d0703ecbfd7136665f9f041ac9306226877f846048/generic-1.1.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-16 11:38:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "gaphor",
"github_project": "generic",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "generic"
}