|
1 | 1 | # Changelog
|
2 | 2 |
|
| 3 | +### 1.5.0 - Major refactoring and bugfixes |
| 4 | + |
| 5 | +**Function creation API:** |
| 6 | + |
| 7 | + - renamed all `handler` into `impl` for clarity. Fixes [#27](https://github.com/smarie/python-makefun/issues/27). |
| 8 | + - renamed `addsource` and `addhandler` arguments as `add_source` and `add_impl` respectively, for consistency |
| 9 | + - 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). |
| 10 | + - the function name is now optional in signatures provided as string. |
| 11 | + - now setting `__qualname__` attribute |
| 12 | + - 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). |
| 13 | + |
| 14 | + **Wrappers:** |
| 15 | + |
| 16 | + - `@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). |
| 17 | + - `@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) |
| 18 | + |
| 19 | + |
3 | 20 | ### 1.4.0 - Non-representable default values are now handled correctly
|
4 | 21 |
|
5 | 22 | 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).
|
@@ -51,8 +68,8 @@ Now a string signature can be provided to `@with_signature` without problem. Fix
|
51 | 68 |
|
52 | 69 | `create_function` and `@with_signature`:
|
53 | 70 |
|
54 |
| - - New `modulename` parameter to override the module name. Fixes [#14](https://github.com/smarie/python-makefun/issues/14) |
55 |
| - - 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](https://github.com/smarie/python-makefun/issues/16) |
| 71 | + - New `module_name` parameter to override the module name. Fixes [#14](https://github.com/smarie/python-makefun/issues/14) |
| 72 | + - the handler is now available as a field of the generated function (under `__func_impl__`). New `addhandler` parameter (default: True) controls this behaviour. Fixes [#16](https://github.com/smarie/python-makefun/issues/16) |
56 | 73 |
|
57 | 74 |
|
58 | 75 | Misc:
|
@@ -92,7 +109,7 @@ Improved design by getting rid of the regular expression parser to check paramet
|
92 | 109 |
|
93 | 110 | - Handler functions can now receive the dynamically created function as first argument, by using `create_function(func_signature, func_handler, inject_as_first_arg=True)`. Fixes [#1](https://github.com/smarie/python-makefun/issues/1)
|
94 | 111 |
|
95 |
| - - Renamed `_call_` into `_call_handler_` in the generated code. |
| 112 | + - Renamed `_call_` into `_func_impl_` in the generated code. |
96 | 113 |
|
97 | 114 | Misc:
|
98 | 115 |
|
|
0 commit comments