Skip to content

1.5.0 - Major refactoring and bugfixes

Compare
Choose a tag to compare
@smarie smarie released this 13 Mar 13:02
· 304 commits to main since this release

Function creation API:

  • renamed all handler into impl for clarity. Fixes #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.
  • 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.

Wrappers:

  • @wraps and create_wrapper now offer a new_sig argument. In that case the __wrapped__ attribute is not set. Fixes #25.
  • @wraps and create_wrapper now correctly preserve the __dict__ and other metadata from the wrapped item. Fixes #24

See documentation page for details.