{ "info": { "author": "Pawe\u0142 Sobkowiak", "author_email": "pawel.sobkowiak@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "A Descriptor class implementing weakref properties in Python 2/3\n================================================================\n\nAdd a property that acts like a normal attribute,\nbut keeps a weak reference to anything that is assigned\nto it.\n\nExample:\n\n First let's define WeakValue using WeakProperty\n and SomeClass that will be weakly referenced::\n\n >>> import weakref_property\n >>> import gc\n\n >>> class WeakValue(object):\n ... value = weakref_property.WeakProperty('value')\n\n >>> class SomeClass(object):\n ... pass\n\n You can assign and retrieve a value::\n\n >>> a = SomeClass()\n >>> obj = WeakValue()\n >>> obj.value = a\n >>> obj.value # doctest: +ELLIPSIS\n <__main__.SomeClass object at ...>\n\n But it is kept as a weakref, so it can get collected.\n If it is collected, the property returns None::\n\n >>> del a\n >>> gc.collect() # force gc to collect `a` object\n 0\n >>> obj.value\n\n You can also delete the value completelly::\n\n >>> del obj.value\n >>> obj.value\n Traceback (most recent call last):\n ...\n AttributeError: 'WeakValue' object has no attribute 'value'\n\n Sadly, weakrefs do not work on tuples, ints\n and not-subclassed lists and dicts::\n\n >>> obj.value = []\n Traceback (most recent call last):\n ...\n TypeError: cannot create weak reference to 'list' object\n", "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/popotam/python-weakref-property", "keywords": "weakref,property,descriptor", "license": "GPLv3", "maintainer": null, "maintainer_email": null, "name": "weakref_property", "package_url": "https://pypi.org/project/weakref_property/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/weakref_property/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/popotam/python-weakref-property" }, "release_url": "https://pypi.org/project/weakref_property/0.1/", "requires_dist": null, "requires_python": null, "summary": "A Descriptor class implementing weakref properties in Python", "version": "0.1" }, "last_serial": 1192132, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "3943ab8ab26bdb5bf17d329e202b3f58", "sha256": "258180f09fc0eb19a4483b642796c9000a31e0f25491635cf4e91850b91ea32d" }, "downloads": -1, "filename": "weakref_property-0.1.tar.gz", "has_sig": false, "md5_digest": "3943ab8ab26bdb5bf17d329e202b3f58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14357, "upload_time": "2014-08-16T02:24:20", "url": "https://files.pythonhosted.org/packages/d0/32/fe976e59a132a52ff79e3a714b8f938a518205ddf490634dfac39aed2194/weakref_property-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "3943ab8ab26bdb5bf17d329e202b3f58", "sha256": "258180f09fc0eb19a4483b642796c9000a31e0f25491635cf4e91850b91ea32d" }, "downloads": -1, "filename": "weakref_property-0.1.tar.gz", "has_sig": false, "md5_digest": "3943ab8ab26bdb5bf17d329e202b3f58", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14357, "upload_time": "2014-08-16T02:24:20", "url": "https://files.pythonhosted.org/packages/d0/32/fe976e59a132a52ff79e3a714b8f938a518205ddf490634dfac39aed2194/weakref_property-0.1.tar.gz" } ] }