def ExtensionReplacer(new_ext):
return functools.partial(replace_extension, new_ext)<EOL>
A reusable function to replace a file's extension with another

>>> repl = ExtensionReplacer('.pdf')
>>> repl('myfile.doc')
'myfile.pdf'
>>> repl('myfile.txt')
'myfile.pdf'
>>> repl('myfile')
'myfile.pdf'