Enable ruff SIM102 rule (#11341)

* Enable ruff SIM102 rule

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
Maxim Smolskiy
2024-04-02 04:27:56 +03:00
committed by GitHub
parent f8a948914b
commit 93fb555e0a
13 changed files with 73 additions and 50 deletions

View File

@ -92,10 +92,9 @@ def eliminate(values, s, d):
dplaces = [s for s in u if d in values[s]]
if len(dplaces) == 0:
return False ## Contradiction: no place for this value
elif len(dplaces) == 1:
# d can only be in one place in unit; assign it there
if not assign(values, dplaces[0], d):
return False
# d can only be in one place in unit; assign it there
elif len(dplaces) == 1 and not assign(values, dplaces[0], d):
return False
return values