Mel <mwil...@the-wire.com> writes: > def file_to_hash(path, m = hashlib.md5()): > > hashlib.md5 *is* called once; that is when the def statement is executed.
Very interesting, I certainly wasn't clear on this. So after that def, the created hashlib object is in the module's scope and can be accessed via file_to_hash.__defaults__[0]. -- http://mail.python.org/mailman/listinfo/python-list