{ "info": { "author": "Gregor Giesen", "author_email": "giesen@zaehlwerk.net", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)", "Programming Language :: Python", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "===============================================\nPEP487: Simpler customisation of class creation\n===============================================\n\nThis is a backport of PEP487's simpler customisation of class\ncreation by Martin Teichmann \nfor Python versions before 3.6.\n\nPEP487 is free software: you can redistribute it and/or modify it\nunder the terms of the GNU General Public License as published\nby the Free Software Foundation, either version 3 of the License,\nor (at your option) any later version.\n\n\nSubclass init\n=============\n\n>>> from pep487 import PEP487Object\n>>> class FooBase(PEP487Object):\n... foos = set()\n...\n... def __init_subclass__(cls, **kwargs):\n... cls.foos.add(cls.__name__)\n\nUsing `PEP487Object` as base class all subclasses of FooBase\nwill add their name to the common class variable 'foos'.\n\n>>> class Foo1(FooBase):\n... pass\n>>> class Foo2(FooBase):\n... pass\n\nHence:\n\n>>> FooBase.foos\n{'Foo1', 'Foo2'}\n\n\n\nProperty names and owner\n========================\n\nIf a class object has a method `__set_name__` upon declaration\nof an PEP487Object class, it will be called:\n\n>>> class NamedProperty:\n... def __set_name__(self, owner, name):\n... self.context = owner\n... self.name = name\n\n>>> class Bar(PEP487Object):\n... foo = NamedProperty()\n... bar = NamedProperty()\n\nConsequently:\n\n>>> Bar.foo.name is 'foo' and Bar.foo.context is Bar\nTrue\n>>> Bar.bar.name is 'bar' and Bar.bar.context is Bar\nTrue\n\n\nAbstract base classes\n=====================\n\nSince `PEP487Object` has a custom metaclass, it is incompatible\nto `abc.ABC`. Therefore `pep487` contains patched versions of `ABC`\nand `ABCMeta`.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/zaehlwerk/pep487", "keywords": "pep487", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "pep487", "package_url": "https://pypi.org/project/pep487/", "platform": "", "project_url": "https://pypi.org/project/pep487/", "project_urls": { "Homepage": "https://github.com/zaehlwerk/pep487" }, "release_url": "https://pypi.org/project/pep487/1.0.1/", "requires_dist": [ "pytest; extra == 'test'", "pytest-cov; extra == 'test'", "pytest-flakes; extra == 'test'", "pytest-mock; extra == 'test'", "pytest-pep8; extra == 'test'", "pytest-runner; extra == 'test'" ], "requires_python": "", "summary": "PEP487 - Simpler customisation of class creation", "version": "1.0.1" }, "last_serial": 3941088, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "7039672b70854e27c3ac4cb257d56dd1", "sha256": "603e87a6ef4fe0167fb6956613037cba31719c0128874ca425e4c6487b83ba74" }, "downloads": -1, "filename": "pep487-1.0.0.tar.gz", "has_sig": true, "md5_digest": "7039672b70854e27c3ac4cb257d56dd1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4027, "upload_time": "2017-02-14T17:23:58", "url": "https://files.pythonhosted.org/packages/f6/74/283e1ec59614e736cb6c504a390d5ba21df92a4619a7c60b14bc690a2399/pep487-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "fd472c5b3db4dbe8f805b4fc856fe99a", "sha256": "8d6545f261df40becc95cceeb2cd75fc736e04731da48eb54e01e7e227060b39" }, "downloads": -1, "filename": "pep487-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fd472c5b3db4dbe8f805b4fc856fe99a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5535, "upload_time": "2018-06-07T21:08:26", "url": "https://files.pythonhosted.org/packages/59/4e/70a2b16a5cb39f690c6708c9db4ff003ce0c05aed12e95a7e3705df8b4eb/pep487-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f70ef21c22a88edaa74dce9fa6da394", "sha256": "ccca1d5b70fce64a1d52bdc3a873b47d7d67fe5b2fbf8c303f102c83f3458bfd" }, "downloads": -1, "filename": "pep487-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0f70ef21c22a88edaa74dce9fa6da394", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4008, "upload_time": "2018-06-07T21:08:27", "url": "https://files.pythonhosted.org/packages/44/58/2ef69797a40ea69c0d204d5d03bb8a1cb1ea278c510b52deb01e48d07231/pep487-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fd472c5b3db4dbe8f805b4fc856fe99a", "sha256": "8d6545f261df40becc95cceeb2cd75fc736e04731da48eb54e01e7e227060b39" }, "downloads": -1, "filename": "pep487-1.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "fd472c5b3db4dbe8f805b4fc856fe99a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5535, "upload_time": "2018-06-07T21:08:26", "url": "https://files.pythonhosted.org/packages/59/4e/70a2b16a5cb39f690c6708c9db4ff003ce0c05aed12e95a7e3705df8b4eb/pep487-1.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0f70ef21c22a88edaa74dce9fa6da394", "sha256": "ccca1d5b70fce64a1d52bdc3a873b47d7d67fe5b2fbf8c303f102c83f3458bfd" }, "downloads": -1, "filename": "pep487-1.0.1.tar.gz", "has_sig": false, "md5_digest": "0f70ef21c22a88edaa74dce9fa6da394", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4008, "upload_time": "2018-06-07T21:08:27", "url": "https://files.pythonhosted.org/packages/44/58/2ef69797a40ea69c0d204d5d03bb8a1cb1ea278c510b52deb01e48d07231/pep487-1.0.1.tar.gz" } ] }