From 4bdc1abc6da7f2cbd6b561a0755ad316acdebecb Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Thu, 19 Feb 2015 11:32:11 -0800 Subject: [PATCH] README.rst: Add detail to example This shows more details of the the `funcsigs.Signature` object and adds syntax highlighting to the example. --- README.rst | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f04b7b4..fb79dbc 100644 --- a/README.rst +++ b/README.rst @@ -18,13 +18,21 @@ Example ------- To obtain a signature object, pass the target function to the -``funcsigs.signature`` function. :: +``funcsigs.signature`` function. + +.. code-block:: python >>> from funcsigs import signature >>> def foo(a, b=None, *args, **kwargs): ... pass - + ... >>> sig = signature(foo) + >>> sig + + >>> sig.parameters + OrderedDict([('a', ), ('b', ), ('args', ), ('kwargs', )]) + >>> sig.return_annotation + For the details of the signature object, refer to the either the package of standard library documentation.