You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looks like consider-using-tuple does not analyze in/not in operators in conditional statements:
name = 'test'
if name in ['value 1', 'value 2']:
print('found something')
elif name in ['value 3', 'value 4']:
print('found another thing')
elif name not in ['value 5', 'value 6']:
print('passed some filter')
If you launch pylint with pylint test.py --enable=all --enable-all-extentions you would get a suggestion to use set: 2:11: R6201: Consider using set for membership test (use-set-for-membership). See #4776 and attached merge request for full discussion.
Bug description
Looks like
consider-using-tuple
does not analyzein/not in
operators in conditional statements:Configuration
No response
Command used
Pylint output
Expected behavior
Warnings should suggest to convert all three lists to tuples.
Pylint version
OS / Environment
No response
Additional dependencies
No response
The text was updated successfully, but these errors were encountered: