v0.4.0
What's Changed
- BREAKING: The signature of paramclasses changes for paramclasses with a
__post_init__method, depending on whether it accepts positional and/or keyword arguments. This makes documenting (withsphinxfor example) cleaner/more precise as there will be nopost_init_argsif__post_init__does not accept positional arguments for example. The drawback though is that different paramclasses may have different signatures, and one cannot simply use a genericMyParamClass(post_init_args, post_init_kwargs, **params)call. As such, if users strongly express preference for previous behaviour, we might revert to it. - If
__post_init__accepts both positional and keyword arguments, then users might mistakenly try to useMyParamClass(post_init_kwargs, **params)when they do not want to specify positional arguments. Normally, this would ultimately silently translate to a (probably unexpected)__post_init__(*post_init_kwargs, **{})call. To avoid such mistakes, we explicitly raise an error ifpost_init_argsis of a mapping type. - Tested for python up to
3.14.0b4.
- 36 py314 by @eliegoudout in #40
- 39 fix signature post init by @eliegoudout in #41
Full Changelog: v0.3.6...v0.4.0