Makefun

Latest version: v1.15.6

Safety actively analyzes 682404 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 7 of 9

1.5.1

`add_signature_parameters` now correctly inserts parameters in the right order when they are prepended (using `first=`). Fixed [29](https://github.com/smarie/python-makefun/issues/29).

1.5.0

**Function creation API:**

- renamed all `handler` into `impl` for clarity. Fixes [27](https://github.com/smarie/python-makefun/issues/27).
- renamed `addsource` and `addhandler` arguments as `add_source` and `add_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` or `create_wrapper`, because that's probably what you want to do (= reuse not only the signature but also all metadata). Fixes [26](https://github.com/smarie/python-makefun/issues/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` in `create_function` and `with_signature`, and are the ones from the wrapped function in `create_wrapper` and `wraps` as intuitively expected. Fixes [28](https://github.com/smarie/python-makefun/issues/28).

**Wrappers:**

- `wraps` and `create_wrapper` now offer a `new_sig` argument. In that case the `__wrapped__` attribute is not set. Fixes [25](https://github.com/smarie/python-makefun/issues/25).
- `wraps` and `create_wrapper` now correctly preserve the `__dict__` and other metadata from the wrapped item. Fixes [24](https://github.com/smarie/python-makefun/issues/24)

1.4.0

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](https://github.com/smarie/python-makefun/issues/23).

1.3.0

- Now providing a `wraps`, equivalent of `functools.wraps`; and a `create_wrapper` equivalent of `functools.update_wrapper`. Fixes [21](https://github.com/smarie/python-makefun/issues/21)

- `with_signature` now does not override the `__name__` when signature is provided as a function. Fixes [22](https://github.com/smarie/python-makefun/issues/22)

- `add_signature_parameters` now accepts that parameters are provided as single elements (not necessarily iterables)

- Updated documentation

1.2.0

`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](https://github.com/smarie/python-makefun/issues/20).

1.1.2

Fixed `isgeneratorfunction` for old python versions, see [decorator63](https://github.com/micheles/decorator/pull/63).

Python<3.3-specific function body is now not loaded at all if not needed.

Page 7 of 9

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.