itransferwee: Simplify the check for duplicates filenames - transferwee - Download/upload file via wetransfer.com Err tccr.it 70 hgit clone https://github.com/iamleot/transferwee URL:https://github.com/iamleot/transferwee tccr.it 70 1Log /r/transferwee/log.gph tccr.it 70 1Files /r/transferwee/files.gph tccr.it 70 1Refs /r/transferwee/refs.gph tccr.it 70 1README /r/transferwee/file/README.md.gph tccr.it 70 i--- Err tccr.it 70 1commit 17c9da77dcb9daa3e92447aff4206f0d52e3a4cc /r/transferwee/commit/17c9da77dcb9daa3e92447aff4206f0d52e3a4cc.gph tccr.it 70 1parent b1574d0c0d1aa345d26549e322c5b10286876572 /r/transferwee/commit/b1574d0c0d1aa345d26549e322c5b10286876572.gph tccr.it 70 hAuthor: Leonardo Taccari URL:mailto:iamleot@gmail.com tccr.it 70 iDate: Tue, 8 May 2018 14:04:48 +0200 Err tccr.it 70 i Err tccr.it 70 itransferwee: Simplify the check for duplicates filenames Err tccr.it 70 i Err tccr.it 70 iWe can just use set() and avoid the `*' completely. Err tccr.it 70 i Err tccr.it 70 iDiffstat: Err tccr.it 70 i M transferwee.py | 2 +- Err tccr.it 70 i Err tccr.it 70 i1 file changed, 1 insertion(+), 1 deletion(-) Err tccr.it 70 i--- Err tccr.it 70 1diff --git a/transferwee.py b/transferwee.py /r/transferwee/file/transferwee.py.gph tccr.it 70 i@@ -230,7 +230,7 @@ def upload(files: List[str], message: str = '', sender: str = None, Err tccr.it 70 i Err tccr.it 70 i # Check that there are no duplicates filenames (despite different dirname()) Err tccr.it 70 i filenames = [ os.path.basename(f) for f in files ] Err tccr.it 70 i- if len(files) != len({ *filenames }): Err tccr.it 70 i+ if len(files) != len(set(filenames)): Err tccr.it 70 i return None Err tccr.it 70 i Err tccr.it 70 i transfer_id = None Err tccr.it 70 .