blob: f04b7b422cf51b67586703f2ae09eb86c1ce6ba9 [file] [log] [blame]
Aaron Ilesc18d6942013-01-06 13:12:00 +11001funcsigs
2========
Aaron Ilesa3eb2292013-01-06 21:23:25 +11003
4``funcsigs`` is a backport of the `PEP 362`_ function signature features from
5Python 3.3's `inspect`_ module. The backport is compatible with Python 2.6, 2.7
6as well as 3.2 and up.
7
Aaron Ilesdd3a4812013-05-29 22:34:46 +10008|pypi_version|
9
Aaron Ilesa3eb2292013-01-06 21:23:25 +110010Documentation
11-------------
12
13The reference documentation is standard library documentation for the
14`inspect`_ module in Python3. This documentation has been included in the
15``funcsigs`` package documentation hosted on `Read The Docs`_.
16
Aaron Iles269bcf92013-01-06 22:13:28 +110017Example
18-------
19
20To obtain a signature object, pass the target function to the
21``funcsigs.signature`` function. ::
22
23 >>> from funcsigs import signature
24 >>> def foo(a, b=None, *args, **kwargs):
25 ... pass
26
27 >>> sig = signature(foo)
28
29For the details of the signature object, refer to the either the package of
30standard library documentation.
31
Aaron Ilesa3eb2292013-01-06 21:23:25 +110032Compatability
33-------------
34
35The ``funcsigs`` backport has been tested against:
36
37* CPython 2.6
38* CPython 2.7
39* CPython 3.2
Aaron Iles8ae3ff82013-01-07 21:58:49 +110040* PyPy 1.9
Aaron Ilesa3eb2292013-01-06 21:23:25 +110041
42Continuous integration testing is provided by `Travis CI`_.
43
Aaron Iles8ae3ff82013-01-07 21:58:49 +110044Under Python 2.x there is a compatability issue when a function is assigned to
45the ``__wrapped__`` property of a class after it has been constructed.
46Similiarily there under PyPy directly passing the ``__call__`` method of a
47builtin is also a compatability issues. Otherwise the functionality is
48believed to be uniform between both Python2 and Python3.
Aaron Ilesa3eb2292013-01-06 21:23:25 +110049
50Issues
51------
52
53Source code for ``funcsigs`` is hosted on `GitHub`_. Any bug reports or feature
Aaron Iles59ab8ac2013-05-30 21:16:18 +100054requests can be made using GitHub's `issues system`_. |build_status| |coverage|
Aaron Ilesa3eb2292013-01-06 21:23:25 +110055
56Copyright
57---------
58
59This is a derived work of CPython under the terms of the `PSF License
Aaron Iles082cc6d2013-01-06 22:14:06 +110060Agreement`_. The original CPython inspect module, its unit tests and
61documentation are the copyright of the Python Software Foundation. The derived
62work is distributed under the `Apache License Version 2.0`_.
Aaron Ilesa3eb2292013-01-06 21:23:25 +110063
64.. _Apache License Version 2.0: http://opensource.org/licenses/Apache-2.0
65.. _GitHub: https://github.com/aliles/funcsigs
66.. _PSF License Agreement: http://docs.python.org/3/license.html#terms-and-conditions-for-accessing-or-otherwise-using-python
67.. _Travis CI: http://travis-ci.org/
68.. _Read The Docs: http://funcsigs.readthedocs.org/
69.. _PEP 362: http://www.python.org/dev/peps/pep-0362/
70.. _inspect: http://docs.python.org/3/library/inspect.html#introspecting-callables-with-the-signature-object
71.. _issues system: https://github.com/alies/funcsigs/issues
Aaron Ilesdd3a4812013-05-29 22:34:46 +100072
Aaron Ilesa3eb2292013-01-06 21:23:25 +110073.. |build_status| image:: https://secure.travis-ci.org/aliles/funcsigs.png?branch=master
74 :target: http://travis-ci.org/#!/aliles/funcsigs
Aaron Ilesdd3a4812013-05-29 22:34:46 +100075 :alt: Current build status
76
Aaron Iles59ab8ac2013-05-30 21:16:18 +100077.. |coverage| image:: https://coveralls.io/repos/aliles/funcsigs/badge.png?branch=master
78 :target: https://coveralls.io/r/aliles/funcsigs?branch=master
79 :alt: Coverage status
80
Aaron Ilesdd3a4812013-05-29 22:34:46 +100081.. |pypi_version| image:: https://pypip.in/v/funcsigs/badge.png
82 :target: https://crate.io/packages/funcsigs/
83 :alt: Latest PyPI version