Skip to content

Instantly share code, notes, and snippets.

  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
[Freeze a function with a function argument with partial] I guess it should work, but I can freeze a function with function arguments as well. https://docs.python.org/3/library/functools.html#functools.partial #python #multiprocessing
# test partial
from functools import partial
def frozen_func():
return 2
def target_func(x, frozen_func):
return x + frozen_func()
test_partial = partial(target_func, frozen_func=frozen_func)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment