{ "info": { "author": "James Powell", "author_email": "james@dontusethiscode.com", "bugtrack_url": null, "classifiers": [], "description": "#### Disclaimer\n\ndutc = Don't Use This Code (!!)\n\n# Did You mean?\n\nThis module implements \"Did You Mean?\" functionality on AttributeError.\n\n*It's not what it does but how it does it!*\n\n```python\n>>> class Foo(object):\n... def bar(self): pass\n... \n>>> foo = Foo()\n```\n\nWithout `didyoumean`:\n\n```python\n>>> foo.baz\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: 'Foo' object has no attribute 'baz'\n```\n\n```python\n>>> getattr(foo, 'baz')\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: 'Foo' object has no attribute 'baz'\n```\n\nAfter importing `didyoumean`:\n\n```python\n>>> import didyoumean\n>>> foo.baz\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: 'Foo' object has no attribute 'baz'\n\nMaybe you meant: .bar\n```\n\n```python\n>>> import didyoumean\n>>> getattr(foo, 'baz')\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: 'Foo' object has no attribute 'baz'\n\nMaybe you meant: .bar\n```\n\nIt works on old-style classes, new-style classes, type objects, builtins, everything.\n\n```python\n>>> # old-style class\n... \n>>> class Foo:\n... def bar(self): pass\n... \n>>> Foo.baz\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: class Foo has no attribute 'baz'\n\nMaybe you meant: .bar\n```\n\n```python\n>>> # new-style class\n... \n>>> class Foo(object):\n... def quux(self): pass\n... \n>>> foo = Foo()\n>>> foo.baz\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: 'Foo' object has no attribute 'baz'\n\nMaybe you meant: .quux\n```\n\n```python\n>>> # types\n... \n>>> class Bar(Foo):\n... def xyzzy(self): pass\n... \n>>> Bar.qux\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: type object 'Bar' has no attribute 'qux'\n\nMaybe you meant: .quux\n\n>>> Bar.xyzz\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: type object 'Bar' has no attribute 'xyzz'\n\nMaybe you meant: .xyzzy\n```\n\n```python\n>>> # builtins & everything else?\n... \n>>> object._new__\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: type object 'object' has no attribute '_new__'\n\nMaybe you meant: .__new__\n\n>>> object()._new__\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: 'object' object has no attribute '_new__'\n\nMaybe you meant: .__new__\n```\n\n```python\n>>> # works with getattr\n... \n>>> getattr(object, '_new__')\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: type object 'object' has no attribute '_new__'\n\nMaybe you meant: .__new__\n```\n\n```python\n>>> # works with getattr\n... # ... even if you don't want it to!\n... \n>>> g = getattr\n>>> import didyoumean\n>>> getattr(object, '_new__')\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: type object 'object' has no attribute '_new__'\n\nMaybe you meant: .__new__\n\n>>> g(object, '_new__')\nTraceback (most recent call last):\n File \"\", line 1, in \nAttributeError: type object 'object' has no attribute '_new__'\n\nMaybe you meant: .__new__\n```\n\n#### How do I install it?\n\n```shell\n$ pip install dutc-didyoumean\n```\n\n#### How do I turn it off?\n\nRestart your interpreter.\n\n#### How does it work?\n\nWell, see, that's the fun of it.\n\n#### Is this approach \u2018portable\u2019?\n\nProbably not.\n\n#### Does this approach work on ...?\n\nIt works on Python 2. It works on Linux. It works on x86_64. It's unfortunate that it works anywhere.\n\n#### Should I use this code?\n\nDefinitely not.\n\n### License (GPLv3)\n\nCopyright \u00a9 2014 James Powell \n\nThis program is free software: you can redistribute it and/or modify it under\nthe terms of the GNU General Public License as published by the Free Software\nFoundation, either version 3 of the License, or (at your option) any later\nversion.\n\nThis program is distributed in the hope that it will be useful, but WITHOUT ANY\nWARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A\nPARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with\nthis program. If not, see .", "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/dutc/didyoumean", "keywords": null, "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "dutc-didyoumean", "package_url": "https://pypi.org/project/dutc-didyoumean/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/dutc-didyoumean/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/dutc/didyoumean" }, "release_url": "https://pypi.org/project/dutc-didyoumean/0.1.6/", "requires_dist": null, "requires_python": null, "summary": "\"Did You Mean?\" on AttributeError", "version": "0.1.6" }, "last_serial": 1282895, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "b3c59b0997fb1076b129df36a7ba8666", "sha256": "7de7ed9848af23753fabdedf21149166595797c35feb0fa2be95ad4eb8894334" }, "downloads": -1, "filename": "dutc-didyoumean-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b3c59b0997fb1076b129df36a7ba8666", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6026, "upload_time": "2014-10-25T03:37:41", "url": "https://files.pythonhosted.org/packages/f4/ac/4d88847a5a101f9e3988e7eea58ae12f550ba626cedd3139acaf1c1321cd/dutc-didyoumean-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "3b59fef78dc79e6b4a8a4e085c1f1b7e", "sha256": "7a711dbcaee9ad01e8828646a4be262fc6cdfa594b79bd8cabfc8f0efcde5a9c" }, "downloads": -1, "filename": "dutc-didyoumean-0.1.1.tar.gz", "has_sig": false, "md5_digest": "3b59fef78dc79e6b4a8a4e085c1f1b7e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6127, "upload_time": "2014-10-25T04:14:14", "url": "https://files.pythonhosted.org/packages/56/31/7d344140d868a1130edd1268b2a07b87fdee2c5d6b2d71f1ce832990d8e9/dutc-didyoumean-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "87797ad67bf830f3f1483bdeef1635da", "sha256": "2ce26ad3aaa29dcd475f1b717ffb9044960a7ab69b8db9581cdfdc7b89383baf" }, "downloads": -1, "filename": "dutc-didyoumean-0.1.2.tar.gz", "has_sig": false, "md5_digest": "87797ad67bf830f3f1483bdeef1635da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6101, "upload_time": "2014-10-25T04:38:23", "url": "https://files.pythonhosted.org/packages/b2/20/63925a4df3d6fce3a7f1a0d032a6649099886fef597dd39be400d4d11816/dutc-didyoumean-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "cf834b1b9393aca9b4308263a679828d", "sha256": "12c6e8436cd84eed0db09c2ee36c6476b54f3c5ba5e79fa1dee1896a3498667f" }, "downloads": -1, "filename": "dutc-didyoumean-0.1.3.tar.gz", "has_sig": false, "md5_digest": "cf834b1b9393aca9b4308263a679828d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6094, "upload_time": "2014-10-25T04:48:34", "url": "https://files.pythonhosted.org/packages/a5/65/d5cbfe179d933223f5d3781b6d23c8654bd7ab5a8b3057e720ddf9cd4b04/dutc-didyoumean-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "b3206ea92d7efe1c7294e2ce1d59b195", "sha256": "670290eb3f669d9164d026c94e0fc39ce091a2dfb6687348d17fc942e6676c2c" }, "downloads": -1, "filename": "dutc-didyoumean-0.1.4.tar.gz", "has_sig": false, "md5_digest": "b3206ea92d7efe1c7294e2ce1d59b195", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6616, "upload_time": "2014-10-25T05:56:03", "url": "https://files.pythonhosted.org/packages/b3/26/d91067e698ecafd577174e1b69bdf67d593a34d3a7ee4bade420e2546f42/dutc-didyoumean-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "4b8a5671fe145eafba42d1c7219ad2b8", "sha256": "ed269cd6506bb0fb902863382aef3d694c49601e950e4638b83a2a4bebfe6fdd" }, "downloads": -1, "filename": "dutc-didyoumean-0.1.5.tar.gz", "has_sig": false, "md5_digest": "4b8a5671fe145eafba42d1c7219ad2b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6989, "upload_time": "2014-10-25T06:47:19", "url": "https://files.pythonhosted.org/packages/a7/e3/e4e91533d6f2697008bdefc43f93d60f87a72d548546cdc4dc438ef9bcf0/dutc-didyoumean-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "b6434623e85e38435e353fbe91cf8862", "sha256": "f1444aa4f796cc0b229374ac3dafa8a5cbd3b6a7fb684206731182255f151527" }, "downloads": -1, "filename": "dutc-didyoumean-0.1.6.tar.gz", "has_sig": false, "md5_digest": "b6434623e85e38435e353fbe91cf8862", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7424, "upload_time": "2014-10-26T00:54:34", "url": "https://files.pythonhosted.org/packages/ea/26/0efc77643705870a668138321ad1d83b8a82088593bd2accd4baaf7fad91/dutc-didyoumean-0.1.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b6434623e85e38435e353fbe91cf8862", "sha256": "f1444aa4f796cc0b229374ac3dafa8a5cbd3b6a7fb684206731182255f151527" }, "downloads": -1, "filename": "dutc-didyoumean-0.1.6.tar.gz", "has_sig": false, "md5_digest": "b6434623e85e38435e353fbe91cf8862", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7424, "upload_time": "2014-10-26T00:54:34", "url": "https://files.pythonhosted.org/packages/ea/26/0efc77643705870a668138321ad1d83b8a82088593bd2accd4baaf7fad91/dutc-didyoumean-0.1.6.tar.gz" } ] }