Skip to content

v0.4.0

Choose a tag to compare

@eliegoudout eliegoudout released this 18 Jul 19:28
· 17 commits to main since this release
3b5211a

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 (with sphinx for example) cleaner/more precise as there will be no post_init_args if __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 generic MyParamClass(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 use MyParamClass(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 if post_init_args is of a mapping type.
  • Tested for python up to 3.14.0b4.

Full Changelog: v0.3.6...v0.4.0