github smarie/python-makefun 1.5.0
1.5.0 - Major refactoring and bugfixes

latest releases: 1.15.2, 1.15.1, 1.15.0...
5 years ago

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.

Don't miss a new python-makefun release

NewReleases is sending notifications on new releases.