Python decorator for very-variadic functions
Python Shell
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
doc
docs
.gitignore
.travis.yml
LICENSE
MANIFEST.in
README.rst
run_development_cycle.sh
setup.py
variadic.py

README.rst

variadic is a Python (2.7+ and 3.4+) function decorator to write variadic functions accepting a mix of arguments and iterables of those arguments. Oh, and they keep their argspec, so tools doing introspection (Sphinx doc, IDEs, etc.) will work well. No ugly f(*args, **kwds) in your doc!

Note that PEP 448 makes variadic obsolete: if you're using Python 3.5+, you should keep plain variadic functions and call them with several argument unpackings.

It's licensed under the MIT license. It's available on the Python package index, its documentation and its source code are on GitHub.

Questions? Remarks? Bugs? Want to contribute? Open an issue!

https://badge.waffle.io/jacquev6/variadic.png?label=ready&title=ready

Quick start

Install from PyPI:

$ pip install variadic

Import:

>>> from variadic import variadic

Define a function:

>>> @variadic(int)
... def f(*args):
...   return args
>>> f(1, 2, [3, 4], xrange(5, 8))
(1, 2, 3, 4, 5, 6, 7)