-
Notifications
You must be signed in to change notification settings - Fork 2k
Closed
Labels
bugSomething isn't workingSomething isn't workingpreviewRelated to preview mode featuresRelated to preview mode features
Description
If you run with preview set, then the FURB118 check makes an unsafe replacement, you can see me rolling back the change wntrblm/nox@a91dbe2 to make the tests pass, the difference in behavior can be shown with this MWE:
>>> class A:
... pass
...
>>> A.__eq__ = lambda a, b: a == b
>>> A() == A()
Traceback (most recent call last):
File "<python-input-5>", line 1, in <module>
A() == A()
File "<python-input-4>", line 1, in <lambda>
A.__eq__ = lambda a, b: a == b
^^^^^^
File "<python-input-4>", line 1, in <lambda>
A.__eq__ = lambda a, b: a == b
^^^^^^
File "<python-input-4>", line 1, in <lambda>
A.__eq__ = lambda a, b: a == b
^^^^^^
[Previous line repeated 988 more times]
RecursionError: maximum recursion depth exceeded
>>> import operator
>>> A.__eq__ = operator.eq
>>> A() == A()
Traceback (most recent call last):
File "<python-input-8>", line 1, in <module>
A() == A()
TypeError: eq expected 2 arguments, got 1Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingpreviewRelated to preview mode featuresRelated to preview mode features