Makefun

Latest version: v1.15.1

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

Scan your dependencies

Page 6 of 8

1.6.1

Fixed `partial` to support missing and empty docstring. Fixes [31](https://github.com/smarie/python-makefun/issues/31).

1.6.0

New method `partial` that behaves like `functools.partial`, and equivalent decorator `with_partial`. Fixes [30](https://github.com/smarie/python-makefun/issues/30).

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

Page 6 of 8

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.