Skip to content

Commit

Permalink
update doc and history and prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
piccolbo committed Jul 1, 2020
1 parent 0a896f7 commit c2cda6b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
History
=======

0.10.0 (2020-7-1)
-----------------

* Support for return values in signatures

0.9.2 (2019-10-1)
-----------------
Expand Down
3 changes: 2 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ Features
--------

* Define reusable parameters with defaults, conversion and validation logic, documentation, preferred position in the signature and whether keyword-only.
* Define reusable signatures as ordered maps from names to parameters.
* Define reusable return values with conversion and validation logic and documentation.
* Define reusable signatures as ordered maps from names to parameters with optional return value definition.
* Combine signatures to create complex ones on top of simple ones.
* Decorate functions and methods with their signatures. Enforced at load time. Conversion and validation logic executed at call time.
* Not hot about signatures? You can just use parameters as in::
Expand Down
6 changes: 5 additions & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ To use autosig in a project::

To define a signature::

api_sig = Signture(x = param(default=0, converter=int))
api_sig = Signature(x = param(default=0, converter=int))

To associate that signature with a function::

Expand All @@ -29,6 +29,10 @@ Simple signatures can be combined to for more complex ones::

sig = Signature(x=param())+Signature(y=param())

Signatures can now include return values::

api_sig = Signature(Retval(validator=int), x = param(default=0, converter=int))

You can skip signatures altogehter and just capture commonalities between arguments with the argumentless form of the decorator::

x_arg = param(...)
Expand Down

0 comments on commit c2cda6b

Please sign in to comment.