ccxt-websockets-db-updater icon indicating copy to clipboard operation
ccxt-websockets-db-updater copied to clipboard

Fix mismatched parentheses in utils.py

Open minusworld opened this issue 5 years ago • 0 comments

Hi there! While scanning a punch of Python code, I noticed some imbalanced parentheses in your code.

The actual scan finding looks for anyone using strings in Python with boolean operators like and and or -- using strings in this way often doesn't do what is expected.

>>> d = {'a': 1, 'b': 2}
>>> 'a' and 'b' in d
True
>>> 'a' in d
True
>>> 'a' and 'b'
'b'
>>> 'b' in d
True
>>> 'b' and 'c' in d
False
>>> 'c' and 'b' in d
True
>>> 'zip' or 'pkg'
'zip'
>>> 

However, this scanner detected something else in your code, identifying what looks like mismatched parentheses in utils.py. This PR puts the parentheses in the right places.

Anyway, hope this helps! If you're interested in scanning your code for more issues, check out https://semgrep.live! Cheers!

minusworld avatar Jun 18 '20 22:06 minusworld