{ "info": { "author": "Michael Amy", "author_email": "mikeamycoder@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "# class_extension\nA mechanism for extending python classes.\n\nCode for adding methods to classes outside of class definitions.\nFor reference: another version of the same idea was found, \nproposed by GVR himself:\nhttps://mail.python.org/pipermail/python-dev/2008-January/076194.html\nI'm providing this version as a slightly safer alternative.\nIt has various extra checks that avoid issues.\n\nPros:\n* Promotes functional cohesion; \n Cross-class inter-dependant code can stay together,\n easing understanding (only need to refer to one file to \n see how something works or make changes).\n* Actually safer than python's class definition mechanism due \n to the existing-name-check assertion. i.e. we can't define\n something twice with extensions, but we can with ordinary\n classes.\n* Provides a way to avoid circular imports when adding methods.\n This can be a huge benefit for a large project.\n* Provides a good way to extend classes from external libraries.\n This can also be a nice benefit, as sometimes it's not \n possible to use your subclass inside an external library.\n\nCons:\n* Methods don't appear to metaclasses at class instantiation time.\n This shouldn't be a problem, as the metaclasses shouldn't \n be concerned with methods added in this way anyway.\n* Surprises developers who expect all methods to be inside a class definition.\n\nNotes:\nMonkey-patching is expressly disallowed. \nThis means you can't replace an attribute on an existing class.\nHowever, you can override a superclass method, like an ordinary class can\nand you can always create a subclass and extend that.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MikeAmy/class_extension", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "class_extension", "package_url": "https://pypi.org/project/class_extension/", "platform": "", "project_url": "https://pypi.org/project/class_extension/", "project_urls": { "Homepage": "https://github.com/MikeAmy/class_extension" }, "release_url": "https://pypi.org/project/class_extension/1.0.3/", "requires_dist": null, "requires_python": "", "summary": "Allows classes to be extended", "version": "1.0.3" }, "last_serial": 3856758, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "961c6981304449ae439ec6a6cbf994d3", "sha256": "e740bf99b2b67f3827f615aef928b47ebb529805e350cd6dc603246726454d68" }, "downloads": -1, "filename": "class_extension-1.0.0.tar.gz", "has_sig": false, "md5_digest": "961c6981304449ae439ec6a6cbf994d3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2549, "upload_time": "2015-10-30T17:51:45", "url": "https://files.pythonhosted.org/packages/10/9d/1f21c783865eb1b6d435b45db89a43a40b7441f784c937ce3fa273b125ec/class_extension-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "7cc5daad34ca9fe29f6c5954f24a50df", "sha256": "36246e24a17a9e651f69bde543c7409ec873c105bb01e84850578e72caa91e3b" }, "downloads": -1, "filename": "class_extension-1.0.1.tar.gz", "has_sig": false, "md5_digest": "7cc5daad34ca9fe29f6c5954f24a50df", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2593, "upload_time": "2015-10-30T18:29:29", "url": "https://files.pythonhosted.org/packages/64/75/fa431889bd23744447c4ff91653817e9de05f9b537fbbb767a1110795b8d/class_extension-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "89a87405575aba615d2c98003da82a78", "sha256": "ea3ea4e0d8996db589e170025d84fc91780b0ca4a574517035e1fa09b4f11ec5" }, "downloads": -1, "filename": "class_extension-1.0.2.tar.gz", "has_sig": false, "md5_digest": "89a87405575aba615d2c98003da82a78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2852, "upload_time": "2018-05-12T12:16:30", "url": "https://files.pythonhosted.org/packages/2f/92/63b09aa2436d215f4bdde74b96af30b4ad966c47a07340ee78818755eef3/class_extension-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "23a6f5b010b3ad06a7cdd7ea7a76bd79", "sha256": "fa7b269fd979ae2a1b6cc03103795d19fbf2c73d8cef391c459260677ea411df" }, "downloads": -1, "filename": "class_extension-1.0.3.tar.gz", "has_sig": false, "md5_digest": "23a6f5b010b3ad06a7cdd7ea7a76bd79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2857, "upload_time": "2018-05-12T14:49:14", "url": "https://files.pythonhosted.org/packages/78/34/1d123c06a4ca6a11c3eba673ed68a8aee28adc56bd08cdb448b3f25fd62f/class_extension-1.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "23a6f5b010b3ad06a7cdd7ea7a76bd79", "sha256": "fa7b269fd979ae2a1b6cc03103795d19fbf2c73d8cef391c459260677ea411df" }, "downloads": -1, "filename": "class_extension-1.0.3.tar.gz", "has_sig": false, "md5_digest": "23a6f5b010b3ad06a7cdd7ea7a76bd79", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2857, "upload_time": "2018-05-12T14:49:14", "url": "https://files.pythonhosted.org/packages/78/34/1d123c06a4ca6a11c3eba673ed68a8aee28adc56bd08cdb448b3f25fd62f/class_extension-1.0.3.tar.gz" } ] }