We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 03c627d commit f75ef82Copy full SHA for f75ef82
1 file changed
src/snakemake/scheduling/milp.py
@@ -44,7 +44,7 @@ def nondefault_solvers(self) -> List[str]:
44
def __iter__(self) -> Iterator[str]:
45
if self.default is not None:
46
yield self.default
47
- yield from self.nondefault_solvers
+ yield from self.nondefault_solvers
48
49
def __contains__(self, x: object) -> bool:
50
try:
@@ -55,9 +55,7 @@ def __contains__(self, x: object) -> bool:
55
return False
56
57
def __len__(self) -> int:
58
- if self.default is None:
59
- return 0
60
- return 1 + len(self.nondefault_solvers)
+ return (1 if self.default is not None else 0) + len(self.nondefault_solvers)
61
62
63
lp_solvers = LpSolverCollection()
0 commit comments