Created
June 11, 2015 10:55
-
-
Save alesegdia/6272e1ff559c5ec3a37b to your computer and use it in GitHub Desktop.
python: functions i.
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 upload_to_rename(instance, filename): | |
# handle instance and filename | |
return "sample" | |
def build_concat(basepath, f): | |
def _ret(instance, filename): | |
return basepath + f(instance, filename) | |
return _ret | |
foo = build_concat("some/base/path/", upload_to_rename) | |
foo(None, None) # returns 'some/base/path/sample' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment