{ "info": { "author": "Matthias Bussonnier", "author_email": "bussonniermatthias@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: BSD License" ], "description": "Unstable\n========\n\nBecause sometime documenting a function is unstable is not enough.\n\nBecause often, reaching to the documentation to know if something is\nstable takes too much time.\n\nBecause once it's stable, you'll forget to re-check again.\n\nInstallation\n============\n\n::\n\n $ pip install unstable\n\nUtility\n=======\n\nThis module provides a decorator to mark function as ``unstable``.\nUnstable function will **raise** an ``UnstableWarning``\\ unless used in\nan ``unstable`` context. Thus preventing you from using an unstable\nfunction by mistake.\n\nProvide an ``with unstable()`` context manger which silence (or log) the\nexceptions raised by unstable functions. By default an ``unstable``\ncontext manager that does not detect any use of ``unstable`` functions\nwill log a ``StableWarning``.\n\nSee Readme for more information.\n\nUsage\n=====\n\nMark a function as unstable\n---------------------------\n\n.. code:: python\n\n from unstable import unstable\n\n @unstable\n def frobulate(frumious, bandersnatch):\n galumphing(frumious) + bandersnatch\n\nMark a branch as being unstable\n-------------------------------\n\n.. code:: python\n\n from unstable import unstable\n\n def galumphing(frumious):\n if frumious:\n unstable.here_be_dragons(reason='frumious=True')\n # ...\n else:\n # ...\n\nUsing unstable code\n-------------------\n\nBy default unstable code will raise an ``UnstableWarning``, wrap\nunstable code in an ``unstable`` context manager.\n\n.. code:: python\n\n from unstable import unstable\n\n with unstable:\n fumious(True, 25) # Will Behave\n\n frumious(False, 18) # will Fail with UnstableWarning\n\n galumphing(False) # fine\n\n with unstable:\n galumphing(True) # fine\n\nContext manager or decorator ?\n==============================\n\nQ : Is unstable a context manager or decorator ? A : Both. It's magic.\n\nAdvance usage:\n==============\n\nI need to write the doc, PR welcome.\n\nWhy ?\n=====\n\nInspired by Rust's ``#[Unstable]``, which allows you to use it only\nexplicitly (and I'm not talking about safety here). This mimick it (as\nmuch as it can).\n\nI want to be able to \"ship\" unstable code and N.x version of a library\nand tell users \"Use at your own risk\", though no-one read the doc. Here\nit make things obvious, don't use it unless you **meant** to. Also the\n\"instability\" in contagious as function using unstable functions will\nbecome (partially) unstable. The instability boundary is obvious, it's\nthe context manager.\n\nWhat about try/except ?\n-----------------------\n\nIt will/can catch the exception, though the called function will not\nrun.\n\nTodo\n====\n\nAdd a plugin for sphinx which automatically mark the function in the doc\nas unstable.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Carreau/unstable", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "unstable", "package_url": "https://pypi.org/project/unstable/", "platform": "", "project_url": "https://pypi.org/project/unstable/", "project_urls": { "Homepage": "https://github.com/Carreau/unstable" }, "release_url": "https://pypi.org/project/unstable/0.5.1/", "requires_dist": null, "requires_python": ">=3", "summary": "Unstable", "version": "0.5.1" }, "last_serial": 2608200, "releases": { "0.5.0": [ { "comment_text": "", "digests": { "md5": "87a618386fc2d0b56254128db3db7344", "sha256": "d9413a147d50533a9abb3854a6aa5d571ee5c8d68fc7a77ce74dddf453526245" }, "downloads": -1, "filename": "unstable-0.5.0-py3-none-any.whl", "has_sig": false, "md5_digest": "87a618386fc2d0b56254128db3db7344", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 73947, "upload_time": "2017-01-22T00:55:32", "url": "https://files.pythonhosted.org/packages/a2/3e/7f2cce8034d0f32eaf08f0a1098684b013835f5578f7bdc2479624768fea/unstable-0.5.0-py3-none-any.whl" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "7dfd9fc8464274869f1e49f7cd106fcf", "sha256": "331c29b1bcb9521cb4319957d1493563b1d0a8f289e53a6fe6bd45e3d3bf261e" }, "downloads": -1, "filename": "unstable-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7dfd9fc8464274869f1e49f7cd106fcf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 74452, "upload_time": "2017-01-31T02:47:06", "url": "https://files.pythonhosted.org/packages/80/2b/08592d9bf22f536bea640b7828e5f7b817190c9e22f0b8305ffb82cf48df/unstable-0.5.1-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "7dfd9fc8464274869f1e49f7cd106fcf", "sha256": "331c29b1bcb9521cb4319957d1493563b1d0a8f289e53a6fe6bd45e3d3bf261e" }, "downloads": -1, "filename": "unstable-0.5.1-py3-none-any.whl", "has_sig": false, "md5_digest": "7dfd9fc8464274869f1e49f7cd106fcf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 74452, "upload_time": "2017-01-31T02:47:06", "url": "https://files.pythonhosted.org/packages/80/2b/08592d9bf22f536bea640b7828e5f7b817190c9e22f0b8305ffb82cf48df/unstable-0.5.1-py3-none-any.whl" } ] }