{ "info": { "author": "Chris Warrick", "author_email": "chris@chriswarrick.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 1 - Planning", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "====================================================================\nmerge_args \u2014 merge signatures of two functions with Advanced Hackery\n====================================================================\n\n.. image:: https://travis-ci.org/Kwpolska/merge_args.svg?branch=master\n :target: https://travis-ci.org/Kwpolska/merge_args\n\nThis small library uses Advanced Python Hackery to change the signature of a\nfunction to be a mixture of itself and a function that it wraps. It\u2019s like\n``functools.wraps``, but it allows the wrapped function to add its own\narguments into the mix.\n\nUsage\n-----\n\n.. code:: python\n\n from merge_args import merge_args\n\n def old(foo, bar):\n \"\"\"This is old's docstring.\"\"\"\n print(foo, bar)\n return foo + bar\n\n @merge_args(old)\n def new(prefix, foo, *args, **kwargs):\n return old(prefix + foo, *args, **kwargs)\n\nIf you then run ``help(new)``, this is the output:\n\n.. code:: text\n\n Help on function new in module __main__:\n\n new(prefix, foo, bar)\n This is old's docstring.\n\nHow it works?\n-------------\n\nI wrote a detailed blog post, describing the ins and outs of how this package works:\n\nhttps://chriswarrick.com/blog/2018/09/20/python-hackery-merging-signatures-of-two-python-functions/\n\nThis module was inspired by F4D3C0D3 on #python (freenode IRC).\n\nLicense\n-------\nCopyright \u00a9 2018, Chris Warrick.\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n1. Redistributions of source code must retain the above copyright\n notice, this list of conditions, and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions, and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the author of this software nor the names of\n contributors to this software may be used to endorse or promote\n products derived from this software without specific prior written\n consent.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\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/Kwpolska/merge_args", "keywords": "merge_args", "license": "3-clause BSD", "maintainer": "", "maintainer_email": "", "name": "merge-args", "package_url": "https://pypi.org/project/merge-args/", "platform": "any", "project_url": "https://pypi.org/project/merge-args/", "project_urls": { "Homepage": "https://github.com/Kwpolska/merge_args" }, "release_url": "https://pypi.org/project/merge-args/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Merge signatures of two functions with Advanced Hackery.", "version": "0.1.1" }, "last_serial": 4292871, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f2f5542d3d78b60bb7d583a539451724", "sha256": "b2c93a11d9b0156ddde64a961dbc8c1cd829700e46c9d11e2dbcd1c962723000" }, "downloads": -1, "filename": "merge_args-0.1.0-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "f2f5542d3d78b60bb7d583a539451724", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4500, "upload_time": "2018-09-20T13:49:46", "url": "https://files.pythonhosted.org/packages/22/42/6e557ca64a4d43867d76af5f369f70160715248c245f88f77b662959a1ae/merge_args-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b7dbf36024a55b9a75a79bdfe4645ff8", "sha256": "e52a20200af0673f5a9faf3b6ddd8f1e2c6ef2f4477889bc7edad7115e8c6ee6" }, "downloads": -1, "filename": "merge_args-0.1.0.tar.gz", "has_sig": true, "md5_digest": "b7dbf36024a55b9a75a79bdfe4645ff8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5071, "upload_time": "2018-09-20T13:49:49", "url": "https://files.pythonhosted.org/packages/a6/db/754eb28eb6c589168e4c059474510da7d0609e48c720987e68129c21e7f1/merge_args-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "db710eace15b784348c9a3f1a68d326a", "sha256": "e83549fdf24ca613c914656279ae3df4dd24badd45a14a7007160928a98e3ecb" }, "downloads": -1, "filename": "merge_args-0.1.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "db710eace15b784348c9a3f1a68d326a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4535, "upload_time": "2018-09-20T14:20:12", "url": "https://files.pythonhosted.org/packages/73/cc/4767fa8307857b611c4776e30cbaaa0c36233b683d80a10b898bc1bcc36b/merge_args-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6558b144f2a2081aabea7c74e7f5a396", "sha256": "682ea78a38f7cd1726cfc825470fe68cc09e42ea613ab799634836fdcfc772e6" }, "downloads": -1, "filename": "merge_args-0.1.1.tar.gz", "has_sig": true, "md5_digest": "6558b144f2a2081aabea7c74e7f5a396", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5147, "upload_time": "2018-09-20T14:20:13", "url": "https://files.pythonhosted.org/packages/e9/3c/c61a07433f7c0e79622fd9f9262fc835aa3b7b56aa29bb32ca09793cca7b/merge_args-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db710eace15b784348c9a3f1a68d326a", "sha256": "e83549fdf24ca613c914656279ae3df4dd24badd45a14a7007160928a98e3ecb" }, "downloads": -1, "filename": "merge_args-0.1.1-py2.py3-none-any.whl", "has_sig": true, "md5_digest": "db710eace15b784348c9a3f1a68d326a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4535, "upload_time": "2018-09-20T14:20:12", "url": "https://files.pythonhosted.org/packages/73/cc/4767fa8307857b611c4776e30cbaaa0c36233b683d80a10b898bc1bcc36b/merge_args-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6558b144f2a2081aabea7c74e7f5a396", "sha256": "682ea78a38f7cd1726cfc825470fe68cc09e42ea613ab799634836fdcfc772e6" }, "downloads": -1, "filename": "merge_args-0.1.1.tar.gz", "has_sig": true, "md5_digest": "6558b144f2a2081aabea7c74e7f5a396", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5147, "upload_time": "2018-09-20T14:20:13", "url": "https://files.pythonhosted.org/packages/e9/3c/c61a07433f7c0e79622fd9f9262fc835aa3b7b56aa29bb32ca09793cca7b/merge_args-0.1.1.tar.gz" } ] }