python-makefun icon indicating copy to clipboard operation
python-makefun copied to clipboard

Dynamically create python functions with a proper signature.

Results 26 python-makefun issues
Sort by recently updated
recently updated
newest added

`typing.get_type_hints` uses the `__wrapped__` attribute for finding the namespace of the original (undecorated) method was defined in. See [here](https://github.com/python/cpython/blob/605e9c66ad367b54a847f9fc65447a071742f554/Lib/typing.py#L2314-L2315) for the implementation in the standard library. This allows dereferencing of...

Fixes #85 by using the `__signature__` attribute specified by [PEP 362](https://peps.python.org/pep-0362/) where appropriate, and setting the `__wrapped__` attribute in all cases. I think the fix for #66 introduced an issue...

Sometimes adding a parameter at the beginning or end of parameters list would make the resulting signature invalid. Typically, adding a keyword-only parameter before a keyword-or-positional, or adding a parameter...

See https://github.com/tylerwince/flake8-bandit/issues/21 Currently our fix is to add `bandit

This could rely on `partial(f)` if `deep=False`, For `deep=True` we should rely on one of the recipes here: - https://stackoverflow.com/questions/13503079/how-to-create-a-copy-of-a-python-function - https://stackoverflow.com/questions/6527633/how-can-i-make-a-deepcopy-of-a-function-in-python/30714299#30714299

This is work in progress: basically `co_names` should be used (done) But it seems that there are issues with the way the eval dict (globals/locals) is propagated. Indeed when an...

When running this: ``` def original_foo(): raise Exception() makefun.create_function("foo()", original_foo)() ``` I want `foo` to be the name of the function in the stack trace. Any way I can achieve...

These names are available in `co_names`. For example below the `dedent` symbol is not compiled. ```python from textwrap import dedent @compile_fun def foo(): return dedent(" hoho") ``` Unfortunately, handling this...

bug