{ "info": { "author": "Roman Novatorov ", "author_email": "suenweek@protonmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Paramdec\n========\n\nParamdec is a convenient way to create parametrized decorators.\n\nUsage\n-----\n\nCreate your parametrized decorator:\n\n>>> from paramdec import paramdec\n>>> @paramdec\n... def my_dec(func, foo=42, bar=None):\n... def wrapper(*func_args, **func_kwargs):\n... # Process foo and bar\n... return func(*func_args, **func_kwargs)\n... return wrapper\n\nUse it with parameters:\n\n>>> @my_dec(bar=\"bar\")\n>>> def func(): pass\n\nOr without parameters:\n\n>>> @my_dec()\n>>> def func(): pass\n\nOr even without parentheses:\n\n>>> @my_dec\n>>> def func(): pass\n\nAlso, consider using ``functools.wraps`` for your decorators.\n\nLimitations\n-----------\n\n- No positional args supported.\n\nThe rationale behind this is the fact that I have not found any pythonic way to\nmake a decorator differentiate between a function to be decorated and a\ncallback. So if you pass a single callable positional argument to a\nparametrized decorator, it will mistakenly decide that it was called not as a\nfactory but as a casual decorator.\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Suenweek/paramdec", "keywords": "development parametrized decorator", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "paramdec", "package_url": "https://pypi.org/project/paramdec/", "platform": "", "project_url": "https://pypi.org/project/paramdec/", "project_urls": { "Homepage": "https://github.com/Suenweek/paramdec" }, "release_url": "https://pypi.org/project/paramdec/2.1.0/", "requires_dist": null, "requires_python": "", "summary": "A convenient way to create parametrized decorators.", "version": "2.1.0" }, "last_serial": 3322827, "releases": { "2.1.0": [ { "comment_text": "", "digests": { "md5": "4178cb5b647ce39bedda6df9d59e4049", "sha256": "717a07551182ca16dc45d30b207dd8cd3706da9998ac3ec7f06ea81d77d34206" }, "downloads": -1, "filename": "paramdec-2.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4178cb5b647ce39bedda6df9d59e4049", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4922, "upload_time": "2017-11-10T17:32:36", "url": "https://files.pythonhosted.org/packages/a9/8c/c59390dfbb53f858d1b6b7217f74163b90c588f195b11121a61108120033/paramdec-2.1.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4178cb5b647ce39bedda6df9d59e4049", "sha256": "717a07551182ca16dc45d30b207dd8cd3706da9998ac3ec7f06ea81d77d34206" }, "downloads": -1, "filename": "paramdec-2.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4178cb5b647ce39bedda6df9d59e4049", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4922, "upload_time": "2017-11-10T17:32:36", "url": "https://files.pythonhosted.org/packages/a9/8c/c59390dfbb53f858d1b6b7217f74163b90c588f195b11121a61108120033/paramdec-2.1.0-py2.py3-none-any.whl" } ] }