From 331de6eaecca0c44002ffe9f7bcd4eab86e5117e Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Wed, 9 Sep 2020 14:39:30 -0700 Subject: [PATCH] Replace chunk_size=None with CHUNK_SIZE. The idea was that you could overwrite the module-level CHUNK_SIZE so that all future quickids would use it as the default, but I don't like the code clutter and anybody who wants to change the default should write their own partial function if it's that important. --- voussoirkit/quickid.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/voussoirkit/quickid.py b/voussoirkit/quickid.py index 81c663d..feb0e0f 100644 --- a/voussoirkit/quickid.py +++ b/voussoirkit/quickid.py @@ -55,10 +55,7 @@ def matches_file(filename, other_id): with open(filename, 'rb') as handle: return matches_handle(handle, other_id) -def quickid_handle(handle, hashtype='md5', chunk_size=None): - if chunk_size is None: - chunk_size = CHUNK_SIZE - +def quickid_handle(handle, hashtype='md5', chunk_size=CHUNK_SIZE): hasher = HASH_CLASSES[hashtype]() size = handle.seek(0, SEEK_END) handle.seek(0)