{ "info": { "author": "Young Wu", "author_email": "doomsplayer@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Multiple Dispatch 2\n=================\n\n|Build Status| |Coverage Status| |Version Status| |Downloads|\n\nThis is a fork from `mroklin's multipledispatch`_, which is designed to fully support python 3's type annotation.\n\nAnd it only supports python 3.3+.\n\nExample\n-------\n\n.. code-block:: python\n\n >>> from multipledispatch2 import dispatch\n\n >>> @dispatch\n ... def add(x: int, y: int) -> int:\n ... return x + y\n\n >>> @dispatch\n ... def add(x, y):\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 import typing\n\n @dispatch\n def add(*args: typing.Iterable[int]):\n ...\n\n- Diagonal dispatch\n\n.. code-block:: python\n\n a = arbitrary_type()\n @dispatch\n def are_same_type(x: a, y: a) -> bool:\n return True\n\n- Efficient update: The addition of a new signature requires a full resolve of\n the whole function. This becomes troublesome after you get to a few hundred\n type signatures. It can be mitigated by halting and restarting ordering see\n (``halt_ordering`` and ``restart_ordering`` functions for more information.)\n\n\nInstallation and Dependencies\n-----------------------------\n\n``multipledispatch2`` is on the Python Package Index (PyPI):\n\n::\n\n pip install multipledispatch2\n\nor\n\n::\n\n easy_install multipledispatch2\n\n\n``multipledispatch2`` is only supports Python 3.3+. It is pure Python and requires no dependencies beyond the standard\nlibrary.\n\nIt is, in short, a light weight dependency.\n\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- `PEP 0484 - *Type Hints*`_\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.. _`PEP 0484 - *Type Hints*`:\n https://www.python.org/dev/peps/pep-0484/\n\n.. |Build Status| image:: https://travis-ci.org/mrocklin/multipledispatch.png\n :target: https://travis-ci.org/mrocklin/multipledispatch\n.. |Version Status| image:: https://pypip.in/v/multipledispatch/badge.png\n :target: https://pypi.python.org/pypi/multipledispatch/\n.. |Downloads| image:: https://pypip.in/d/multipledispatch/badge.png\n :target: https://pypi.python.org/pypi/multipledispatch/\n.. |Coverage Status| image:: https://coveralls.io/repos/mrocklin/multipledispatch/badge.png\n :target: https://coveralls.io/r/mrocklin/multipledispatch\n.. _License: https://github.com/mrocklin/multipledispatch/blob/master/LICENSE.txt\n\n", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/doomsplayer/multipledispatch2/", "keywords": "dispatch", "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "multipledispatch2", "package_url": "https://pypi.org/project/multipledispatch2/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/multipledispatch2/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/doomsplayer/multipledispatch2/" }, "release_url": "https://pypi.org/project/multipledispatch2/0.4.0/", "requires_dist": null, "requires_python": null, "summary": "Multiple dispatch", "version": "0.4.0" }, "last_serial": 2103855, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "c3df628f12545cb0217d7caddb8b4d9e", "sha256": "63f2390cff4711f6f2270c16c9b41bbb03cab345f25e8d6902325418a4d2962e" }, "downloads": -1, "filename": "multipledispatch2-0.1.0.tar.gz", "has_sig": false, "md5_digest": "c3df628f12545cb0217d7caddb8b4d9e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7555, "upload_time": "2016-04-29T08:56:34", "url": "https://files.pythonhosted.org/packages/0d/92/e260a655127d785ff2a837360fb5d49f57111713120df754f4e22572091c/multipledispatch2-0.1.0.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "92a504e37113898c0c684471e856d2f9", "sha256": "859be508bf817e0c7ba61b4831efd611076486b83774c6d6f9844bb26d27a8a7" }, "downloads": -1, "filename": "multipledispatch2-0.2.0.tar.gz", "has_sig": false, "md5_digest": "92a504e37113898c0c684471e856d2f9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7603, "upload_time": "2016-04-29T09:36:48", "url": "https://files.pythonhosted.org/packages/92/6f/3f455da2712f6a3de3b1184be39c9f872d3cd0b16f20bc5648c98dd86b60/multipledispatch2-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "db6ca0cd18b1728f2783e81ae932630d", "sha256": "173ff6b31fe05a70becc57693dfa3d2be2c18889702e96beb650ea5784ed8887" }, "downloads": -1, "filename": "multipledispatch2-0.3.0.tar.gz", "has_sig": false, "md5_digest": "db6ca0cd18b1728f2783e81ae932630d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7634, "upload_time": "2016-05-04T09:55:33", "url": "https://files.pythonhosted.org/packages/64/d3/256ebcb26b89b29cd60fef771f0d2dc29a92c80542f203c8a267d0ee6b44/multipledispatch2-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "4430e0c54a5d12fef6858d517ecc5f97", "sha256": "d6990cb5008da5bac9f7b3f7a766491cf37fef3166353f1f7a9f1a841732718a" }, "downloads": -1, "filename": "multipledispatch2-0.4.0.tar.gz", "has_sig": false, "md5_digest": "4430e0c54a5d12fef6858d517ecc5f97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8044, "upload_time": "2016-05-07T11:03:37", "url": "https://files.pythonhosted.org/packages/61/59/9e624c36444363a6e2bb15e276fc71cf9e14f6c5ebca59d6dd657a7a6947/multipledispatch2-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4430e0c54a5d12fef6858d517ecc5f97", "sha256": "d6990cb5008da5bac9f7b3f7a766491cf37fef3166353f1f7a9f1a841732718a" }, "downloads": -1, "filename": "multipledispatch2-0.4.0.tar.gz", "has_sig": false, "md5_digest": "4430e0c54a5d12fef6858d517ecc5f97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8044, "upload_time": "2016-05-07T11:03:37", "url": "https://files.pythonhosted.org/packages/61/59/9e624c36444363a6e2bb15e276fc71cf9e14f6c5ebca59d6dd657a7a6947/multipledispatch2-0.4.0.tar.gz" } ] }