python-makefun

Dynamically create python functions with a proper signature.

BSD-3-CLAUSE License

Downloads
13.2M
Stars
119
Committers
10

Bot releases are visible (Hide)

python-makefun - 1.15.3 - bugfix Latest Release

Published by github-actions[bot] 4 months ago

  • Fixed SyntaxError: invalid syntax happening when the default value of one argument of the created function is a
    subclass of a basic primitive. Fixes #98. PR
    #99 by moskupols.

See documentation page for details.

python-makefun - 1.15.2 - bugfix

Published by github-actions[bot] 12 months ago

  • Fixed SyntaxError happening when the name of a native coroutine function to create contains 'return'.
    Fixes #96.

See documentation page for details.

python-makefun - 1.15.1 - bugfixes

Published by github-actions[bot] over 1 year ago

  • Fixed ValueError: Invalid co_name happening on python 2 when the name of a function to create starts or ends with
    _ or contains a double __ . Fixes #91

See documentation page for details.

python-makefun - 1.15.0 - More PEP-compliant `wraps`

Published by github-actions[bot] about 2 years ago

  • wraps now always sets the __wrapped__ attribute, and also sets the __signature__ attribute when the signature changes, as specified by PEP 362. PR by #86 by lucaswiman.

See documentation page for details.

python-makefun - 1.14.0 - Support for lambda functions

Published by github-actions[bot] over 2 years ago

  • create_wrapper, create_function, wraps and with_signature now support lambda functions. They also accept a new parameter co_name to define the name to be used in the compiled code. PR #80 by andrewcleveland.

See documentation page for details.

python-makefun - 1.13.1 - Fixed regression with generators in python 3.5

Published by github-actions[bot] almost 3 years ago

  • Fixed an issue where using partial on a generator function in python 3.5 was raising a SyntaxError. Fixed #79

See documentation page for details.

python-makefun - 1.13.0 - Support for async generator functions

Published by github-actions[bot] almost 3 years ago

See documentation page for details.

python-makefun - 1.12.1 - Bugfix

Published by github-actions[bot] about 3 years ago

  • Fixed TypeError when a func attribute is present on the function provided to create_function. Fixed #76

See documentation page for details.

python-makefun - 1.12.0 - Refactoring and consistency improvement

Published by github-actions[bot] about 3 years ago

  • Fixed partial so that :
    • when no argument is provided, it is equivalent to wraps(f)(f). That is, the __wrapped__ attribute is set. Fixed #73
    • it sets the func attribute just as functools.partial does. Fixed #75
  • Removed pytest-cases dependency as it was a circular one. Fixed #68
  • Now using flake8 for qualimetry and genbadge for badges. Fixed #71
  • Restructured project so that tests are truly independent, to ease rpm/apt/etc. packaging. Fixed #69

See documentation page for details.

python-makefun - 1.11.3 - bugfix with default values representable but not evaluable

Published by github-actions[bot] over 3 years ago

  • When a default value v in a signature is representable but its eval(repr(v)) raises an exception, created signatures would raise an exception instead of automatically protecting the symbol. PR #67 by gcalmettes.

See documentation page for details.

python-makefun - 1.11.2 - bugfix with chained `@wraps`

Published by github-actions[bot] over 3 years ago

  • Fixed issue where @wraps does not remove the __wrapped__ attribute when it wraps an already-wrapped function, and modifies its signature. Fixes #66

See documentation page for details.

python-makefun - 1.11.1 - bugfix

Published by github-actions[bot] over 3 years ago

  • Fixed a bug happening when trying to generate a function where float('inf') is used as a default value. Fixes #63.

See documentation page for details.

python-makefun - 1.11.0 - `partial` bugfixes and improvements + new `wraps` parameters

Published by github-actions[bot] over 3 years ago

  • @wraps now has new arguments prepend_arg and append_arg to quickly prepend or append a new parameter to a function signature. Fixes #65

  • add_signature_parameters can now receive string parameter names in its first and last arguments.

  • Improved generated docstring for partial with better support for preset positional args.

  • partial's behaviour is now aligned with the one in functools.partial in terms of arguments order and kind. Fixes #64

  • Bug fix: passing preset positional arguments to partial does not wipe out the rest of the signature any more. Fixes #62

See documentation page for details.

python-makefun - 1.10.2 - Github actions test

Published by github-actions[bot] over 3 years ago

  • Technical release: validation of the new github actions workflow.

See documentation page for details.

python-makefun - 1.10.1 - Github actions migration

Published by github-actions[bot] over 3 years ago

  • Technical release: validation of the new github actions workflow for PyPi deployment.

See documentation page for details.

python-makefun - 1.10.0 - Removing arguments easily in `@wraps`

Published by smarie over 3 years ago

  • @wraps now offers a remove_params argument allowing one to remove an argument from the exposed signature, typically to create and inject it in the wrapper. Fixes #60

See documentation page for details.

python-makefun - 1.9.5 - Bugfix with `partial` when f has no args

Published by smarie almost 4 years ago

  • partial can now be used to create a copy of a function with no args. Fixed ValueError: Cannot preset 0 positional args, function case_second has only 0 args.. Fixed #59

See documentation page for details.

python-makefun - 1.9.4 - removed six dependency

Published by smarie about 4 years ago

  • Removed unused six dependency. Note: this version will ship in conda forge.

See documentation page for details.

python-makefun - 1.9.3 - Minor compatibility fixes with functools.partial

Published by smarie about 4 years ago

  • @wraps can now be used to wrap a functools.partial. Fixed #57

  • create_function now correctly reuses information from the partialized function if a functools.partial is used as the implementation.

  • create_function now raises a more explicit error when no func_name can be found.

  • makefun.partial now generates a signature that is more consistent with functools.partial. Fixes #58

See documentation page for details.

python-makefun - 1.9.2 - packaging improvements

Published by smarie over 4 years ago

  • packaging improvements: set the "universal wheel" flag to 1, and cleaned up the setup.py. In particular removed dependency to six for setup and added py.typed file, as well as set the zip_safe flag to False. Removed tests folder from package. Fixes #54

See documentation page for details.

Package Rankings
Top 13.26% on Alpine-edge
Top 3.26% on Pypi.org
Top 11.26% on Alpine-v3.18
Top 11.84% on Alpine-v3.15
Top 13.13% on Alpine-v3.16
Top 14.78% on Alpine-v3.17
Top 27.79% on Conda-forge.org
Badges
Extracted from project README
Python versions Build Status Tests Status Coverage Status codecov Flake8 Status Documentation PyPI Downloads Downloads per week GitHub stars