Skip to content

Commit 8e0b310

Browse files
committed
atom: remove no-op operator assignments in intersects()
The tuple assignments ranged, ranged.operator = self, self.operator evaluate the RHS before binding, so .operator is always written back with its own value. With operator now a read-only property they raise AttributeError. Signed-off-by: Matt Turner <mattst88@gentoo.org>
1 parent 59fb0d7 commit 8e0b310

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pym/gentoolkit/atom.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,10 +297,10 @@ def intersects(self, other):
297297

298298
# If we get here at least one of us is a <, <=, > or >=:
299299
if self.operator in ("<", "<=", ">", ">="):
300-
ranged, ranged.operator = self, self.operator
300+
ranged = self
301301
else:
302-
ranged, ranged.operator = other, other.operator
303-
other, other.operator = self, self.operator
302+
ranged = other
303+
other = self
304304

305305
if "<" in other.operator or ">" in other.operator:
306306
# We are both ranged, and in the opposite "direction" (or

0 commit comments

Comments
 (0)