Dynamically create python functions with a proper signature.
BSD-3-CLAUSE License
Bot releases are visible (Hide)
SyntaxError: invalid syntax
happening when the default value of one argument of the created function is aSee documentation page for details.
Published by github-actions[bot] 12 months ago
SyntaxError
happening when the name of a native coroutine function to create contains 'return'
.See documentation page for details.
Published by github-actions[bot] over 1 year ago
ValueError: Invalid co_name
happening on python 2 when the name of a function to create starts or ends with_
or contains a double __
. Fixes #91
See documentation page for details.
Published by github-actions[bot] about 2 years ago
wraps
now always sets the __wrapped__
attribute, and also sets the __signature__
attribute when the signature changes, as specified by PEP 362. PR by #86 by lucaswiman.See documentation page for details.
Published by github-actions[bot] over 2 years ago
create_wrapper
, create_function
, wraps
and with_signature
now support lambda functions. They also accept a new parameter co_name
to define the name to be used in the compiled code. PR #80 by andrewcleveland.See documentation page for details.
Published by github-actions[bot] almost 3 years ago
partial
on a generator function in python 3.5 was raising a SyntaxError
. Fixed #79
See documentation page for details.
Published by github-actions[bot] almost 3 years ago
See documentation page for details.
Published by github-actions[bot] about 3 years ago
TypeError
when a func
attribute is present on the function provided to create_function
. Fixed #76
See documentation page for details.
Published by github-actions[bot] about 3 years ago
partial
so that :
pytest-cases
dependency as it was a circular one. Fixed #68
flake8
for qualimetry and genbadge
for badges. Fixed #71
See documentation page for details.
Published by github-actions[bot] over 3 years ago
v
in a signature is representable but its eval(repr(v))
raises an exception, created signatures would raise an exception instead of automatically protecting the symbol. PR #67 by gcalmettes.See documentation page for details.
Published by github-actions[bot] over 3 years ago
@wraps
does not remove the __wrapped__
attribute when it wraps an already-wrapped function, and modifies its signature. Fixes #66
See documentation page for details.
Published by github-actions[bot] over 3 years ago
float('inf')
is used as a default value. Fixes #63.See documentation page for details.
Published by github-actions[bot] over 3 years ago
@wraps
now has new arguments prepend_arg
and append_arg
to quickly prepend or append a new parameter to a function signature. Fixes #65
add_signature_parameters
can now receive string parameter names in its first
and last
arguments.
Improved generated docstring for partial
with better support for preset positional args.
partial
's behaviour is now aligned with the one in functools.partial
in terms of arguments order and kind. Fixes #64
Bug fix: passing preset positional arguments to partial
does not wipe out the rest of the signature any more. Fixes #62
See documentation page for details.
Published by github-actions[bot] over 3 years ago
See documentation page for details.
Published by github-actions[bot] over 3 years ago
See documentation page for details.
Published by smarie over 3 years ago
@wraps
now offers a remove_params
argument allowing one to remove an argument from the exposed signature, typically to create and inject it in the wrapper. Fixes #60
See documentation page for details.
Published by smarie almost 4 years ago
partial
can now be used to create a copy of a function with no args. Fixed ValueError: Cannot preset 0 positional args, function case_second has only 0 args.
. Fixed #59
See documentation page for details.
Published by smarie about 4 years ago
six
dependency. Note: this version will ship in conda forge.See documentation page for details.
Published by smarie about 4 years ago
@wraps
can now be used to wrap a functools.partial
. Fixed #57
create_function
now correctly reuses information from the partialized function if a functools.partial
is used as the implementation.
create_function
now raises a more explicit error when no func_name
can be found.
makefun.partial
now generates a signature that is more consistent with functools.partial
. Fixes #58
See documentation page for details.
Published by smarie over 4 years ago
setup.py
. In particular removed dependency to six
for setup and added py.typed
file, as well as set the zip_safe
flag to False. Removed tests folder from package. Fixes #54
See documentation page for details.