{ "info": { "author": "Joe Jevnik", "author_email": "joejev@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "License :: OSI Approved :: GNU General Public License v2 (GPLv2)", "Natural Language :: English", "Operating System :: POSIX", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development" ], "description": "``uniontypes 0.1``\n============\n\n|build status|\n\nUnion types For python.\n\nThese appear other languages like Haskell (``Either``) and\nScala (``Union`` or ``\\/``).\n\nThis extends to any arbirary set of types.\n\n\nExamples\n--------\nCreating a union type\n~~~~~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n >>> from uniontypes import Union\n >>> u = Union[list, tuple, str]\n >>> u\n \n\nCreating boxed values\n~~~~~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n >>> u([1, 2, 3])\n Union[list, tuple, str][list] [1, 2, 3]\n >>> u((1, 2, 3))\n Union[list, tuple, str][tuple] (1, 2, 3)\n >>> u('123')\n Union[list, tuple, str][str] '123'\n\nAccessing the inner wrapper types\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n.. code-block:: python\n\n >>> u[list]\n \n >>> u[tuple]\n \n >>> u[str]\n \n\nClass heirarchy\n~~~~~~~~~~~~~~~\n.. code-block:: python\n\n >>> isinstance(u([1, 2, 3]), u)\n True\n >>> isinstance(u([1, 2, 3]), u[list])\n True\n >>> isinstance(u([1, 2, 3]), (u[tuple], u[str]))\n False\n\nOption Types\n------------\n.. code-block:: python\n\n >>> from uniontypes import Option\n >>> oint = Option[int]\n >>> oint\n \n >>> oint(1)\n Option[int] 1\n >>> oint(None)\n Nothing\n >>> oint(None) is oint.nothing\n True\n\n\n.. |build status| image:: https://travis-ci.org/llllllllll/uniontypes.svg?branch=master\n :target: https://travis-ci.org/llllllllll/uniontypes", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/llllllllll/uniontypes", "keywords": null, "license": "GPL-2", "maintainer": null, "maintainer_email": null, "name": "uniontypes", "package_url": "https://pypi.org/project/uniontypes/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/uniontypes/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/llllllllll/uniontypes" }, "release_url": "https://pypi.org/project/uniontypes/0.1.0/", "requires_dist": null, "requires_python": null, "summary": "Union types for python", "version": "0.1.0" }, "last_serial": 1691288, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "71eecede4ce6ab3a24d8109175de8f62", "sha256": "818f486474a574f59ba120d496d99c02a7319c645a1169faa77344ec5ad75c3d" }, "downloads": -1, "filename": "uniontypes-0.0.1.tar.gz", "has_sig": false, "md5_digest": "71eecede4ce6ab3a24d8109175de8f62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3504, "upload_time": "2015-08-23T00:50:20", "url": "https://files.pythonhosted.org/packages/7b/b4/50e5631ebba455e1e790fd232e888f535fa53389f395470b345224fa684b/uniontypes-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "50be5600e90eded6ce444c877223f486", "sha256": "671dec4cbe1a1af6506f24a19f83b589aaa6ed1a78704e4bca7bb4b529e3e8a3" }, "downloads": -1, "filename": "uniontypes-0.1.0.tar.gz", "has_sig": false, "md5_digest": "50be5600e90eded6ce444c877223f486", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3589, "upload_time": "2015-08-24T16:02:45", "url": "https://files.pythonhosted.org/packages/0d/09/a2b47ceb2b926d6184c63cc60ca45b2c7edfbac1e9ac9a05b1d415c332d9/uniontypes-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "50be5600e90eded6ce444c877223f486", "sha256": "671dec4cbe1a1af6506f24a19f83b589aaa6ed1a78704e4bca7bb4b529e3e8a3" }, "downloads": -1, "filename": "uniontypes-0.1.0.tar.gz", "has_sig": false, "md5_digest": "50be5600e90eded6ce444c877223f486", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3589, "upload_time": "2015-08-24T16:02:45", "url": "https://files.pythonhosted.org/packages/0d/09/a2b47ceb2b926d6184c63cc60ca45b2c7edfbac1e9ac9a05b1d415c332d9/uniontypes-0.1.0.tar.gz" } ] }