{ "info": { "author": "", "author_email": "waipu@cirno.de", "bugtrack_url": null, "classifiers": [], "description": "Multiple Dispatch\n=================\n\n|Build Status|\n\nA relatively sane approach to multiple dispatch in Python.\n\nForked from to support and use annotations for dispatch.\nThis implementation of multiple dispatch is efficient, mostly complete,\nperforms static analysis to avoid conflicts, and provides optional namespace\nsupport. It looks good too.\n\n\nExample\n-------\n\n.. code-block:: python\n\n >>> from adispatch import adispatch\n\n >>> @adispatch()\n ... def add(x: int, y: int):\n ... return x + y\n\n >>> @adispatch()\n ... def add(x: object, y: object):\n ... return \"%s + %s\" % (x, y)\n\n >>> add(1, 2)\n 3\n\n >>> add(1, 'hello')\n '1 + hello'\n\nWhat this does\n--------------\n\n- Dispatches on all non-keyword arguments\n\n- Supports inheritance\n\n- Supports instance methods\n\n- Supports union types, e.g. ``(int, float)``\n\n- Supports builtin abstract classes, e.g. ``Iterator, Number, ...``\n\n- Caches for fast repeated lookup\n\n- Identifies possible ambiguities at function definition time\n\n- Provides hints to resolve ambiguities when they occur\n\n- Supports namespaces with optional keyword arguments\n\nWhat this doesn't do\n--------------------\n\n- Vararg dispatch\n\n.. code-block:: python\n\n @adispatch()\n def add(*args: [int]):\n ...\n\n- Diagonal dispatch\n\n.. code-block:: python\n\n a = arbitrary_type()\n @adispatch()\n def are_same_type(x: a, y: a):\n return True\n\n\nInstallation and Dependencies\n-----------------------------\n\n``adispatch`` supports Python 3.2+, is pure python and requires no other dependencies.\n\nLicense\n-------\n\nNew BSD. See License_.\n\n\nLinks\n-----\n\n- `Five-minute Multimethods in Python by Guido`_\n- `multimethods package on PyPI`_\n- `singledispatch in Python 3.4's functools`_\n- `Clojure Protocols`_\n- `Julia methods docs`_\n- `Karpinksi notebook: *The Design Impact of Multiple Dispatch*`_\n- `Wikipedia article`_\n- `PEP 3124 - *Overloading, Generic Functions, Interfaces, and Adaptation*`_\n\n\n.. _`Five-minute Multimethods in Python by Guido`:\n http://www.artima.com/weblogs/viewpost.jsp?thread=101605\n.. _`multimethods package on PyPI`:\n https://pypi.python.org/pypi/multimethods\n.. _`singledispatch in Python 3.4's functools`:\n http://docs.python.org/3.4/library/functools.html#functools.singledispatch\n.. _`Clojure Protocols`:\n http://clojure.org/protocols\n.. _`Julia methods docs`:\n http://julia.readthedocs.org/en/latest/manual/methods/\n.. _`Karpinksi notebook: *The Design Impact of Multiple Dispatch*`:\n http://nbviewer.ipython.org/gist/StefanKarpinski/b8fe9dbb36c1427b9f22\n.. _`Wikipedia article`:\n http://en.wikipedia.org/wiki/Multiple_dispatch\n.. _`PEP 3124 - *Overloading, Generic Functions, Interfaces, and Adaptation*`:\n http://legacy.python.org/dev/peps/pep-3124/\n\n.. |Build Status| image:: https://travis-ci.org/waipu/adispatch.png\n :target: https://travis-ci.org/waipu/adispatch\n.. _License: https://github.com/waipu/adispatch/blob/master/LICENSE", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/waipu/adispatch/", "keywords": "dispatch", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "adispatch", "package_url": "https://pypi.org/project/adispatch/", "platform": "", "project_url": "https://pypi.org/project/adispatch/", "project_urls": { "Homepage": "http://github.com/waipu/adispatch/" }, "release_url": "https://pypi.org/project/adispatch/0.5.0/", "requires_dist": null, "requires_python": "", "summary": "Multiple dispatch in function annotaions", "version": "0.5.0" }, "last_serial": 4685567, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "2a8afd255dbff0ad37ed1298e5ee5fb0", "sha256": "e3bd82b2b227ec12d444de95bdb3416742821ca2fdf175d64db9a9fc4f645a48" }, "downloads": -1, "filename": "adispatch-0.5.0.tar.gz", "has_sig": false, "md5_digest": "2a8afd255dbff0ad37ed1298e5ee5fb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7804, "upload_time": "2019-01-11T14:03:29", "url": "https://files.pythonhosted.org/packages/9b/27/4866facebc15c5458cb709c4022e7cbc150c6fad7d388eb512ae8ae47b37/adispatch-0.5.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2a8afd255dbff0ad37ed1298e5ee5fb0", "sha256": "e3bd82b2b227ec12d444de95bdb3416742821ca2fdf175d64db9a9fc4f645a48" }, "downloads": -1, "filename": "adispatch-0.5.0.tar.gz", "has_sig": false, "md5_digest": "2a8afd255dbff0ad37ed1298e5ee5fb0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7804, "upload_time": "2019-01-11T14:03:29", "url": "https://files.pythonhosted.org/packages/9b/27/4866facebc15c5458cb709c4022e7cbc150c6fad7d388eb512ae8ae47b37/adispatch-0.5.0.tar.gz" } ] }