Skip to content

Releases: smarie/python-decopatch

1.4.0 - Minor dependency version update

13 Mar 13:05

Choose a tag to compare

Now relying on makefun>=1.5.0 where arg names changed a bit.

See documentation page for details.

1.3.0 - Predefined disambiguators and init file fix

12 Mar 16:08

Choose a tag to compare

  • We now provide predefined disambiguators with_parenthesis and no_parenthesis. Fixes #8.

  • Fixed KeyError when the signature contains **kwargs. Fixes #9.

  • Fixed issue when the signature only contains **kwargs. Fixes #10

  • Fixed static checker problem in PyCharm with the symbols (it came back when we moved to an Enum)

  • Improved exception re-raising in flat mode.

  • Minor: fixed init file.

See documentation page for details.

1.2.1 - Flat and double flat symbols: additional protection and bugfix

12 Mar 11:27

Choose a tag to compare

Default-value symbols DECORATED, WRAPPED, F_ARGS and F_KWARGS now have a nicer representation. Fixes #7.

When a symbol is used in a signature where it can not be safely injected as keyword argument, an InvalidSignatureError is now raised. Fixes #6.

See documentation page for details.

1.2.0 - Dependency update for important fix

11 Mar 17:35

Choose a tag to compare

makefun>=1.4.0 is now required, as it fixes a major issue: #5

See documentation page for details.

1.1.1 - Symbols are not classes anymore

11 Mar 15:34

Choose a tag to compare

Default-value symbols DECORATED, WRAPPED, F_ARGS and F_KWARGS are now objects and not classes any more. This prevents IDE to flag the corresponding argument as being misused (not iterable...). Fixes #4.

See documentation page for details.

1.1.0 - Dependency update

11 Mar 12:13

Choose a tag to compare

The double-flat mode now relies on @makefun.wraps, from makefun>=1.3.0. Fixes #3.
Updated documentation accordingly.

See documentation page for details.

1.0.0 - Refactoring + New "double-flat" mode + API changes + documentation

09 Mar 12:30

Choose a tag to compare

API changes:

  • Added support for a new "double-flat" mode so that users can create decorators creating signature-preserving function wrappers with zero level of nesting. Fixes #2.
  • Generated var-positional name for kw-only methods is now '*_'
  • can_first_arg_be_ambiguous parameter removed completely, it was too complex to use.
  • callable_or_cls_firstarg_disambiguator renamed custom_disambiguator to be more intuitive
  • wraps argument renamed flat_mode_decorated_name. It was too similar to the wording used in functools, and specific to the flat mode only. Fixes #1.

Improved behaviour

  • Now the flat mode behaves exactly like nested mode concerning signature-related TypeError. This is because when you use the flat mode we now generate a nested mode function with a true signature.
  • Now the exposed decorator uses the __wrapped__ trick to expose

Major refactoring for code readability:

  • Submodules are now consistent and readable. In particular utils_disambiguation now provides a clear disambiguate_call method, and util_modes provides a clear make_decorator_spec to handle all the per-mode specificity and always come back to a nested case before going further.
  • removed a case in the main module (var-positional) as it was completely covered by the general case.
  • Information is now passed as objects through the various functions, using two main classes SignatureInfo (for static information) and DecoratorUsageInfo (for dynamic/usage information). The information is computed in a lazy way for each to avoid unnecessary signature binding for example.

Major documentation update.

See documentation page for details.

0.5.0 - First version

27 Feb 17:47

Choose a tag to compare

Fully functional with 100+ tests.

See documentation page for details.