Releases: pthom/litgen
Releases · pthom/litgen
v0.21.0
Added
-
Custom bindings API:
You can now manually extend the generated bindings without modifying your C++ headers.LitgenOptions.custom_bindings.add_custom_code_to_class(...)
LitgenOptions.custom_bindings.add_custom_code_to_submodule(...)
LitgenOptions.custom_bindings.add_custom_code_to_main_module(...)
This allows you to inject extra methods, functions, or properties into classes, namespaces, or the main module.
Placeholders (LG_CLASS
,LG_SUBMODULE
,LG_MODULE
) are available inpydef_code
and are replaced automatically.
See the manual section "Manually add custom bindings" for details and examples.
-
Added
customize-class-bases-option
feature (thanks @jnastarot, #26)
Changed
- All options ending with the
__regex
suffix inLitgenOptions
(e.g.fn_exclude_by_name__regex
)
now accept either:- a regex string (
str
), or - a callable (
Callable[[str], bool]
).
This gives more flexibility when filtering functions, classes, or members.
- a regex string (
Fixed
- Enums can now derive from
enum.IntEnum
orenum.IntFlag
- Added
.none()
to arguments whenstd::optional
is used - Do not publish function implementations containing
::
- Fixed case when a return value had a reference (#26, @jnastarot)
New Contributors
- @jnastarot made their first contribution in #26
Full Changelog: v0.20.0...v0.21.0