settings = ('foreground',)
old_value = None
new_value = None

if ('foreground' in settings) and <weak_warning descr="Remove redundant parentheses"><caret>((old_value) or (new_value))</weak_warning>:
  pass
