Skip to content

Releases: smarie/python-makefun

1.3.0 - Aliases for signature-preserving wrapper scenarios

11 Mar 12:04
Compare
Choose a tag to compare
  • Now providing a @wraps, equivalent of functools.wraps; and a create_wrapper equivalent of functools.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`

09 Mar 11:16
Compare
Choose a tag to compare

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

05 Mar 12:08
Compare
Choose a tag to compare

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

27 Feb 17:17
Compare
Choose a tag to compare

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

27 Feb 09:31
Compare
Choose a tag to compare

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`

26 Feb 11:39
Compare
Choose a tag to compare

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

25 Feb 15:55
Compare
Choose a tag to compare

1.0.0 - New parameters, new goodie, and bugfix

25 Feb 15:46
Compare
Choose a tag to compare

@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 new func_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__). New addhandler 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

05 Feb 21:25
Compare
Choose a tag to compare

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

02 Feb 23:11
Compare
Choose a tag to compare

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.