Releases: smarie/python-makefun
1.3.0 - Aliases for signature-preserving wrapper scenarios
-
Now providing a
@wraps
, equivalent offunctools.wraps
; and acreate_wrapper
equivalent offunctools.update_wrapper
. Fixes #21 -
@with_signature
now does not override the__name__
when signature is provided as a function. Fixes #22 -
add_signature_parameters
now accepts that parameters are provided as single elements (not necessarily iterables) -
Updated documentation
See documentation page for details.
1.2.0 - `@with_signature` supports `None`
None
can be used as the desired signature of @with_signature
. This indicated that the user does not want to create a new function but only wants to update the metadata. Fixes #20.
See documentation page for details.
1.1.2 - Fixes
Fixed isgeneratorfunction
for old python versions, see decorator#63.
Python<3.3-specific function body is now not loaded at all if not needed.
See documentation page for details.
1.1.1 - `@with_signature` fix
inject_as_first_arg
was missing from @with_signature
, added it. Fixed #18.
See documentation page for details.
1.1.0 - Support for generators and coroutines
Now create_function
and @with_signature
create the same kind of function than the handler. So if it is a generator, a generator-based coroutine, or an async coroutine, the generated function will adapt. Fixes #6.
See documentation page for details.
1.0.2 - Fixed `@with_signature`
Now a string signature can be provided to @with_signature
without problem. Fixed #17.
See documentation page for details.
1.0.1 - minor: fixed PyPi doc
See documentation page for details.
1.0.0 - New parameters, new goodie, and bugfix
@with_signature
:
- now exposes all options of
create_function
. Fixed #12. - now correctly sets the module name by default. Fixes #13
- now accepts
None
as the newfunc_signature
to declare that the signature is identical to the decorated function. This can be handy to just change the docstring or module name of a function for example. Fixes #15
create_function
and @with_signature
:
- New
modulename
parameter to override the module name. Fixes #14 - the handler is now available as a field of the generated function (under
__call_handler__
). Newaddhandler
parameter (default: True) controls this behaviour. Fixes #16
Misc:
- New goodie to manipulate signatures:
add_signature_parameters
. - Fixed dependencies for documentation auto-build.
See documentation page for details.
0.5.0 - New helper function, and bugfix
New helper function remove_signature_parameters
.
Fixed issue with @with_signature
when argument is a Signature
. Fixes #11
See documentation page for details.
0.4.0 - New `@with_signature` decorator, and `create_function` accepts functions
New decorator @with_signature
to change the signature of a callable. Fixes #3
create_function
now accepts that a function be passed as a signature template. Fixes #10
See documentation page for details.