Last active
October 11, 2021 09:05
-
-
Save ruliana/cfabf066a429c40c3e963813aabaa173 to your computer and use it in GitHub Desktop.
Functional design patterns - builder function (Python)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def builder(builder_param, other_builder_param): | |
# ... optionally some initialization code | |
def the_actual_function(trivial_param): | |
# ... do stuff | |
return something | |
return the_actual_function | |
# Then later... | |
my_func = builder(x, y) | |
my_func(z) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment