{ "info": { "author": "Lincoln de Sousa", "author_email": "lincoln@clarete.li", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "License :: OSI Approved :: MIT License" ], "description": "[![Build Status](https://travis-ci.org/clarete/forbiddenfruit.png?branch=master)](https://travis-ci.org/clarete/forbiddenfruit)\n\n# Forbidden Fruit\n\n![Forbidden Fruit](logo.png)\n\nThis project aims to help you reach heaven while writing tests, but it\nmay lead you to hell if used on production code.\n\nIt basically allows you to patch built-in objects, declared in C through\npython. Just like this:\n\n```python\n>>> from forbiddenfruit import curse\n>>> def words_of_wisdom(self):\n... return self * \"blah \"\n>>> curse(int, \"words_of_wisdom\", words_of_wisdom)\n>>> assert (2).words_of_wisdom() == \"blah blah \"\n```\n\nBoom! That's it, your `int` class now has the `words_of_wisdom` method. Do\nyou want to add a `classmethod` to a built-in class? No problem, just do this:\n\n```python\n>>> from forbiddenfruit import curse\n>>> def hello(self):\n... return \"blah\"\n>>> curse(str, \"hello\", classmethod(hello))\n>>> assert str.hello() == \"blah\"\n```\n\n### Reversing a curse\n\nIf you want to free your object from a curse, you can use the `reverse()`\nfunction. Just like this:\n\n```python\n>>> from forbiddenfruit import curse, reverse\n>>> curse(str, \"test\", \"blah\")\n>>> assert 'test' in dir(str)\n>>> # Time to reverse the curse\n>>> reverse(str, \"test\")\n>>> assert 'test' not in dir(str)\n```\n\n## Compatibility\n\nForbidden Fruit runs on all cpython versions I tested so far, which includes\nthe versions 2.5, 2.6, 2.7, 3.2 and 3.3. Since Forbidden Fruit is fundamentally\ndependent on the C API, this library won't work on other python\nimplementations, such as Jython, pypy, etc.\n\nI might add support for pypy in the future, but It's unlikely that I'll do it\nfor Jython. But I could happily accept patches for them.\n\n## License\n\nLicense (GPLv3)\n\nCopyright (C) 2013 Lincoln Clarete \n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program. If not, see .\n\n### Logo by\n\nKimberly Chandler, from The Noun Project\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/clarete/forbiddenfruit", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "forbiddenfruit", "package_url": "https://pypi.org/project/forbiddenfruit/", "platform": "", "project_url": "https://pypi.org/project/forbiddenfruit/", "project_urls": { "Homepage": "https://github.com/clarete/forbiddenfruit" }, "release_url": "https://pypi.org/project/forbiddenfruit/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Patch python built-in objects", "version": "0.1.3" }, "last_serial": 5168259, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "d7b05f36e76aff19002bd6e6db5a56df", "sha256": "e9d03f329ba9d48c106958f1e03dc88c403df12f1156ee62124fa16af8142a77" }, "downloads": -1, "filename": "forbiddenfruit-0.1.0.tar.gz", "has_sig": false, "md5_digest": "d7b05f36e76aff19002bd6e6db5a56df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5894, "upload_time": "2013-04-12T15:29:35", "url": "https://files.pythonhosted.org/packages/0f/07/8b5b7aea3bbf37dfd1076deb75944aaa960908c4e3e58bca56b36917bd63/forbiddenfruit-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "dd50cba4580444acc54744bf0ab6a1ea", "sha256": "7efe014f2106753dca291e48959c69845c330aa3e3f7385ceca9be2851173fa7" }, "downloads": -1, "filename": "forbiddenfruit-0.1.1.tar.gz", "has_sig": false, "md5_digest": "dd50cba4580444acc54744bf0ab6a1ea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8027, "upload_time": "2013-08-31T20:29:29", "url": "https://files.pythonhosted.org/packages/5a/0d/3d4f9dca4f372a3df22c13ef1eb3c0fff50499f69453e05a101d3f112f7b/forbiddenfruit-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "2069491a480ef61ede5dcf975df43ddb", "sha256": "09ee1959fa34936c15417defa28bfd09cf88ad54c15454bc863d465ed42b8922" }, "downloads": -1, "filename": "forbiddenfruit-0.1.2.tar.gz", "has_sig": false, "md5_digest": "2069491a480ef61ede5dcf975df43ddb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8281, "upload_time": "2016-03-31T03:31:17", "url": "https://files.pythonhosted.org/packages/47/98/ae486fc43ed8a53273c3ec960d52c7623ba1cde57a8bb4a2c6140d6b0675/forbiddenfruit-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "5764c5959daa9d4d3c16f537c4cf8f7a", "sha256": "1188a07cc24a9bd2c529dad06490b80a6fc88cde968af4d7861da81686b2cc8c" }, "downloads": -1, "filename": "forbiddenfruit-0.1.3.tar.gz", "has_sig": false, "md5_digest": "5764c5959daa9d4d3c16f537c4cf8f7a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31868, "upload_time": "2019-04-20T17:41:18", "url": "https://files.pythonhosted.org/packages/03/24/903765ffae7e2022f61dcf4fb6e972c48f9abf64cfa9eb074b6a2a7c78f3/forbiddenfruit-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "5764c5959daa9d4d3c16f537c4cf8f7a", "sha256": "1188a07cc24a9bd2c529dad06490b80a6fc88cde968af4d7861da81686b2cc8c" }, "downloads": -1, "filename": "forbiddenfruit-0.1.3.tar.gz", "has_sig": false, "md5_digest": "5764c5959daa9d4d3c16f537c4cf8f7a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 31868, "upload_time": "2019-04-20T17:41:18", "url": "https://files.pythonhosted.org/packages/03/24/903765ffae7e2022f61dcf4fb6e972c48f9abf64cfa9eb074b6a2a7c78f3/forbiddenfruit-0.1.3.tar.gz" } ] }