Releases: smarie/python-makefun
1.6.7 - Increased tolerance to function signatures in python 2
- In python 2 some libraries such as
attrs
can modify the annotations manually, makingsignature
return a string representation that is not compliant with the language version. This raised aSyntaxError
in previous versions. The new version silently removes all these annotations in python versions that do not support them. Fixes #39.
See documentation page for details.
1.6.6 - Bug fix
- Fixed yet another nasty varpositional-related bug :). Fixes #38.
See documentation page for details.
1.6.5 - Bug fix
- Fixed
NameError
in case of unknown symbols in type hints. Fixes #37.
Note also that this includes non-released 1.6.4 changelog
See documentation page for details.
1.6.3 - Bug fix with type hints in signature
Fixed bug when the return type annotation of the function to create contains non-locally available type hints. Fixes #33.
See documentation page for details.
1.6.2 - Bug fix with type hints in signature
Fixed bug when the signature of the function to create contains non-locally available type hints. Fixes #32.
See documentation page for details.
1.6.1 - `with_partial` and `partial` minor bug fix
Fixed partial
to support missing and empty docstring. Fixes #31.
See documentation page for details.
1.6.0 - added `with_partial` and `partial`
New method partial
that behaves like functools.partial
, and equivalent decorator @with_partial
. Fixes #30.
See documentation page for details.
1.5.1 - bug fix
add_signature_parameters
now correctly inserts parameters in the right order when they are prepended (using first=
). Fixed #29.
See documentation page for details.
1.5.0 - Major refactoring and bugfixes
Function creation API:
- renamed all
handler
intoimpl
for clarity. Fixes #27. - renamed
addsource
andaddhandler
arguments asadd_source
andadd_impl
respectively, for consistency - signatures can not be provided as a callable anymore - that was far too confusing. If the reference signature is a callable, then use
@wraps
orcreate_wrapper
, because that's probably what you want to do (= reuse not only the signature but also all metadata). Fixes #26. - the function name is now optional in signatures provided as string.
- now setting
__qualname__
attribute - default function name, qualname, doc and module name are the ones from
func_impl
increate_function
and@with_signature
, and are the ones from the wrapped function increate_wrapper
and@wraps
as intuitively expected. Fixes #28.
Wrappers:
@wraps
andcreate_wrapper
now offer anew_sig
argument. In that case the__wrapped__
attribute is not set. Fixes #25.@wraps
andcreate_wrapper
now correctly preserve the__dict__
and other metadata from the wrapped item. Fixes #24
See documentation page for details.
1.4.0 - Non-representable default values are now handled correctly
When a non-representable default value was used in the signature to generate, the code failed with a SyntaxError
. This case is now correctly handled, by storing the corresponding variable in the generated function's context. Fixes #23.
See documentation page for details.