{ "info": { "author": "Phillip J. Eby", "author_email": "peak@eby-sarna.com", "bugtrack_url": null, "classifiers": [], "description": "Installing SymbolType (using ``\"easy_install SymbolType\"`` or\n``\"setup.py install\"``) gives you access to the ``peak.util.symbols``\nmodule, previously available only by installing the full PEAK toolkit.\n``peak.util.symbols`` provides a ``Symbol`` type and two built-in symbols\nthat are used by PEAK: ``NOT_FOUND`` and ``NOT_GIVEN``. You can create your\nown symbol objects using the ``Symbol`` type, by giving it the symbol name\nand the name of the module where the symbol is being created::\n\n >>> from peak.util.symbols import Symbol\n >>> AN_EXAMPLE = Symbol('AN_EXAMPLE', __name__)\n\nThe resulting object's ``repr()`` and ``str()`` forms are the same as the name\nyou passed in::\n\n >>> AN_EXAMPLE\n AN_EXAMPLE\n\n >>> str(AN_EXAMPLE)\n 'AN_EXAMPLE'\n\nBut symbols compare equal only to themselves; they are not equal to strings::\n\n >>> AN_EXAMPLE == 'AN_EXAMPLE'\n False\n\n >>> AN_EXAMPLE == AN_EXAMPLE\n True\n\nA symbol's ``__name__`` and ``__module__`` attributes are the original name and\nmodule used to create the symbol::\n\n >>> from peak.util.symbols import NOT_FOUND\n\n >>> NOT_FOUND.__name__\n 'NOT_FOUND'\n\n >>> NOT_FOUND.__module__\n 'peak.util.symbols'\n\nThe reason that symbols want to know their defining module is that this allows\nthem to be pickled and unpickled correctly::\n\n >>> import pickle\n >>> pickle.loads(pickle.dumps(NOT_FOUND))\n NOT_FOUND\n\nSpecifically, it's so that the result of unpickling a symbol is exactly the\nsame object as the original symbol::\n\n >>> pickle.loads(pickle.dumps(NOT_FOUND)) is NOT_FOUND\n True\n\nNote that this means the symbol must be defined at module level within its\nmodule, with the same name that's passed in to it, or else ``pickle`` will\nnot be able to find it when unpickling.\n\nLast, but not least, symbol objects are immutable and cannot be changed in\nany way::\n\n >>> AN_EXAMPLE.foo = \"bar\"\n Traceback (most recent call last):\n ...\n TypeError: Symbols are immutable\n\n\nMailing List\n------------\n\nPlease direct questions regarding this package to the PEAK mailing list; see\nhttp://www.eby-sarna.com/mailman/listinfo/PEAK/ for details.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://peak.telecommunity.com/DevCenter/SymbolType", "keywords": null, "license": "PSF or ZPL", "maintainer": null, "maintainer_email": null, "name": "SymbolType", "package_url": "https://pypi.org/project/SymbolType/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/SymbolType/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://peak.telecommunity.com/DevCenter/SymbolType" }, "release_url": "https://pypi.org/project/SymbolType/1.0/", "requires_dist": null, "requires_python": null, "summary": "Simple \"symbol\" type, useful for enumerations or sentinels", "version": "1.0" }, "last_serial": 785749, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "1e04236cdf29c6e143c219e1c7d009ed", "sha256": "2feb40190e7a4b8a01869bbbbbcbb0e571cc168d2001820be962bec09c8f104b" }, "downloads": -1, "filename": "SymbolType-1.0-py2.3.egg", "has_sig": false, "md5_digest": "1e04236cdf29c6e143c219e1c7d009ed", "packagetype": "bdist_egg", "python_version": "2.3", "requires_python": null, "size": 7850, "upload_time": "2006-05-25T15:44:21", "url": "https://files.pythonhosted.org/packages/3e/17/b7da26e970c959a22eaef29645756026da38915124294a68735cd1511825/SymbolType-1.0-py2.3.egg" }, { "comment_text": "", "digests": { "md5": "9eb77a7d0fce6602ee46b7c5808aa37f", "sha256": "5726c3052e2165e7bab7aa9bc7c91d902835a1108a9164784c542f8cc19e72e1" }, "downloads": -1, "filename": "SymbolType-1.0-py2.4.egg", "has_sig": false, "md5_digest": "9eb77a7d0fce6602ee46b7c5808aa37f", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 4058, "upload_time": "2006-05-25T15:44:44", "url": "https://files.pythonhosted.org/packages/4d/22/60a01c69bcfe47a265fa86c1d00b4f654e4031a41f2af2330b1854faf812/SymbolType-1.0-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "4b9155cc908b249f029a518b8de09368", "sha256": "bcc311398c7dbcc9cbde9fe68bba89b0efe45103410b5949f3acf484fcb14f39" }, "downloads": -1, "filename": "SymbolType-1.0.zip", "has_sig": false, "md5_digest": "4b9155cc908b249f029a518b8de09368", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9507, "upload_time": "2006-05-25T15:44:21", "url": "https://files.pythonhosted.org/packages/2b/32/777db70cba95a80fbc1669e72acb9f4c02584a49476ea26dfbef1902bac5/SymbolType-1.0.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1e04236cdf29c6e143c219e1c7d009ed", "sha256": "2feb40190e7a4b8a01869bbbbbcbb0e571cc168d2001820be962bec09c8f104b" }, "downloads": -1, "filename": "SymbolType-1.0-py2.3.egg", "has_sig": false, "md5_digest": "1e04236cdf29c6e143c219e1c7d009ed", "packagetype": "bdist_egg", "python_version": "2.3", "requires_python": null, "size": 7850, "upload_time": "2006-05-25T15:44:21", "url": "https://files.pythonhosted.org/packages/3e/17/b7da26e970c959a22eaef29645756026da38915124294a68735cd1511825/SymbolType-1.0-py2.3.egg" }, { "comment_text": "", "digests": { "md5": "9eb77a7d0fce6602ee46b7c5808aa37f", "sha256": "5726c3052e2165e7bab7aa9bc7c91d902835a1108a9164784c542f8cc19e72e1" }, "downloads": -1, "filename": "SymbolType-1.0-py2.4.egg", "has_sig": false, "md5_digest": "9eb77a7d0fce6602ee46b7c5808aa37f", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 4058, "upload_time": "2006-05-25T15:44:44", "url": "https://files.pythonhosted.org/packages/4d/22/60a01c69bcfe47a265fa86c1d00b4f654e4031a41f2af2330b1854faf812/SymbolType-1.0-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "4b9155cc908b249f029a518b8de09368", "sha256": "bcc311398c7dbcc9cbde9fe68bba89b0efe45103410b5949f3acf484fcb14f39" }, "downloads": -1, "filename": "SymbolType-1.0.zip", "has_sig": false, "md5_digest": "4b9155cc908b249f029a518b8de09368", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9507, "upload_time": "2006-05-25T15:44:21", "url": "https://files.pythonhosted.org/packages/2b/32/777db70cba95a80fbc1669e72acb9f4c02584a49476ea26dfbef1902bac5/SymbolType-1.0.zip" } ] }