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.9.1 - `@compile_fun` bugfix

Published by smarie over 4 years ago

Fixed OSError: could not get source code or IOError: could not get source code when @compile_fun is used on a function that depends on an already-compiled function. Fixed #51

See documentation page for details.

python-makefun - 1.9.0 - `@compile_fun` improvements, bugfix and better exception

Published by smarie over 4 years ago

@compile_fun: added capability to disable recursive compilation (recurse arg) , and to exclude some names from compilation (except_names arg). Fixed #49 and #50

Fixed issue ValueError: Cell is empty with @compile_fun. Fixed #48

Now raising an UndefinedSymbolError when a symbol is not known at compilation time. One step towards #47

See documentation page for details.

python-makefun - 1.8.0 - new `@compile_fun` goodie

Published by smarie over 4 years ago

New goodie @compile_fun decorator to compile a function so that it can not be navigated to using the debugger. Fixes #46

See documentation page for details.

python-makefun - 1.7.0 - minor goodies update

Published by smarie almost 5 years ago

add_signature_parameters now accepts that one specifies a custom index where to insert the new parameters.

See documentation page for details.

python-makefun - 1.6.11 - Added __version__ attribute

Published by smarie about 5 years ago

Added __version__ attribute to comply with PEP396, following this guide. Fixes #45.

See documentation page for details.

python-makefun - 1.6.10 - Fixed dependencies 2

Published by smarie about 5 years ago

Fixed six dependency: also declared as a setup dependency.

See documentation page for details.

python-makefun - 1.6.9 - Fixed dependencies

Published by smarie about 5 years ago

Added missing six dependency explicitly.

See documentation page for details.

python-makefun - 1.6.8 - Improved performance

Published by smarie over 5 years ago

  • Improved performance of inner method get_signature_string (used by all entry points) after profiling.

See documentation page for details.

python-makefun - 1.6.7 - Increased tolerance to function signatures in python 2

Published by smarie over 5 years ago

  • In python 2 some libraries such as attrs can modify the annotations manually, making signature return a string representation that is not compliant with the language version. This raised a SyntaxError in previous versions. The new version silently removes all these annotations in python versions that do not support them. Fixes #39.

See documentation page for details.

python-makefun - 1.6.6 - Bug fix

Published by smarie over 5 years ago

  • Fixed yet another nasty varpositional-related bug :). Fixes #38.

See documentation page for details.

python-makefun - 1.6.5 - Bug fix

Published by smarie over 5 years ago

  • Fixed NameError in case of unknown symbols in type hints. Fixes #37.

Note also that this includes non-released 1.6.4 changelog

  • Fixed PEP8 error in source code. Fixes #35.

  • Now string signatures can contain a colon. Fixes #36

See documentation page for details.

python-makefun - 1.6.3 - Bug fix with type hints in signature

Published by smarie over 5 years ago

Fixed bug when the return type annotation of the function to create contains non-locally available type hints. Fixes #33.

See documentation page for details.

python-makefun - 1.6.2 - Bug fix with type hints in signature

Published by smarie over 5 years ago

Fixed bug when the signature of the function to create contains non-locally available type hints. Fixes #32.

See documentation page for details.

python-makefun - 1.6.1 - `with_partial` and `partial` minor bug fix

Published by smarie over 5 years ago

Fixed partial to support missing and empty docstring. Fixes #31.

See documentation page for details.

python-makefun - 1.6.0 - added `with_partial` and `partial`

Published by smarie over 5 years ago

New method partial that behaves like functools.partial, and equivalent decorator @with_partial. Fixes #30.

See documentation page for details.

python-makefun - 1.5.1 - bug fix

Published by smarie over 5 years ago

add_signature_parameters now correctly inserts parameters in the right order when they are prepended (using first=). Fixed #29.

See documentation page for details.

python-makefun - 1.5.0 - Major refactoring and bugfixes

Published by smarie over 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.

python-makefun - 1.4.0 - Non-representable default values are now handled correctly

Published by smarie over 5 years ago

When a non-representable default value was used in the signature to generate, the code failed with a SyntaxError. This case is now correctly handled, by storing the corresponding variable in the generated function's context. Fixes #23.

See documentation page for details.

python-makefun - 1.3.0 - Aliases for signature-preserving wrapper scenarios

Published by smarie over 5 years ago

  • Now providing a @wraps, equivalent of functools.wraps; and a create_wrapper equivalent of functools.update_wrapper. Fixes #21

  • @with_signature now does not override the __name__ when signature is provided as a function. Fixes #22

  • add_signature_parameters now accepts that parameters are provided as single elements (not necessarily iterables)

  • Updated documentation

See documentation page for details.

python-makefun - 1.2.0 - `@with_signature` supports `None`

Published by smarie over 5 years ago

None can be used as the desired signature of @with_signature. This indicated that the user does not want to create a new function but only wants to update the metadata. Fixes #20.

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