{ "info": { "author": "Pavel Panchekha", "author_email": "pavpanchekha@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python :: 2.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "MiniOperators for Python\n========================\n\nThis library makes it almost trivial to add extended operators to the python\nlanguage, or to transform existing functions into binary operators. For\nexample, one might take the function ``compose``::\n\n def compose(f, g):\n return lambda *args, **kwargs: f(g(*args, **kwargs))\n\nAnd turn it into an operator, ``|compose|``::\n\n compose = MiniOperator(compose)\n\nThen, the operator can be used as a binary operator [#]_::\n\n f = math.sqrt |compose| (lambda x: x**2 + 1)\n f(0) # 1.0\n\nIf one consistently uses this ``||`` notation and parenthesises\narguments, no problems should arise [#]_.\n\nFurthermore, the operator thus created will support overriding through the\nstandard Python convention of ``____`` and ``__r__`` special\nmethods.\n\nDocumentation\n-------------\n\nThe ``MiniOperator`` constructor can be called in three ways.\n``MiniOperator(f)`` creates an operator named ``f`` that uses ``f`` as its\ndefault operation [#]_. A name can also be explicitely passed:\n``MiniOperator(name, f)``, where ``name`` is a string, will create an operator\nnamed ``name`` that uses ``f`` as a default operation. Finally, one can create\nan operator without specifying a default method: ``MiniOperator(name)``, where\n``name`` is a string, will result in an operator that will throw a\n``NotImplementedError`` when used on most arguments. However, a class will be\nable to explicitely override ``____`` or ``__r__`` to support this\noperator.\n\n.. rubric:: Footnotes\n\n.. [#] Of course, the initial function must be binary --- that is, it must take\n two arguments --- and other obvious restrications apply as well.\n.. [#] The author would like to suggest using two spaces around the operator\n and to take special care parenthesizing expressions.\n.. [#] That is, the name is derived from the ``__name__`` of the passed function.\n The author suggests not overrelying on this form.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/MiniOperators/", "keywords": null, "license": "LICENSE.txt", "maintainer": null, "maintainer_email": null, "name": "MiniOperators", "package_url": "https://pypi.org/project/MiniOperators/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/MiniOperators/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/MiniOperators/" }, "release_url": "https://pypi.org/project/MiniOperators/1.0/", "requires_dist": null, "requires_python": null, "summary": "Miniature operators for Python", "version": "1.0" }, "last_serial": 746258, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "824c856c7bda75f45b136a1c75b83523", "sha256": "2511620a469931150c431fc1569747ac9886b915563f09eb0a74436f1a52d2f7" }, "downloads": -1, "filename": "MiniOperators-1.0.tar.gz", "has_sig": false, "md5_digest": "824c856c7bda75f45b136a1c75b83523", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14398, "upload_time": "2010-03-30T04:04:33", "url": "https://files.pythonhosted.org/packages/4b/50/5bd63fc95044f86f989b50a91f03933c1f4aa2f47798ae58c1fa7ada1a64/MiniOperators-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "824c856c7bda75f45b136a1c75b83523", "sha256": "2511620a469931150c431fc1569747ac9886b915563f09eb0a74436f1a52d2f7" }, "downloads": -1, "filename": "MiniOperators-1.0.tar.gz", "has_sig": false, "md5_digest": "824c856c7bda75f45b136a1c75b83523", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14398, "upload_time": "2010-03-30T04:04:33", "url": "https://files.pythonhosted.org/packages/4b/50/5bd63fc95044f86f989b50a91f03933c1f4aa2f47798ae58c1fa7ada1a64/MiniOperators-1.0.tar.gz" } ] }