Skip to content

Commit 648a0d4

Browse files
Apply ruff/Pylint rule PLR1714
Consider merging multiple comparisons
1 parent 8d050e5 commit 648a0d4

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/blosc2/lazyexpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def ne_evaluate(expression, local_dict=None, **kwargs):
142142

143143
def _get_result(expression, chunk_operands, ne_args, where=None, indices=None, _order=None):
144144
chunk_indices = None
145-
if (expression == "o0" or expression == "(o0)") and where is None:
145+
if expression in {"o0", "(o0)"} and where is None:
146146
# We don't have an actual expression, so avoid a copy except to make contiguous (later)
147147
return chunk_operands["o0"], None
148148
# Apply the where condition (in result)

src/blosc2/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ def visit_Call(self, node): # noqa : C901
581581
return (num,)
582582
raise ValueError("linspace requires either shape or num argument")
583583

584-
elif base_name == "frombuffer" or base_name == "fromiter":
584+
elif base_name in {"frombuffer", "fromiter"}:
585585
count = kwargs.get("count")
586586
return (count,) if count else ()
587587

0 commit comments

Comments
 (0)