You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename Method refactoring is allowed to change the name of methods designed to emulate numeric operations.
It would be nice if Rope sent an alert, as this transformation may cause type errors regarding unsupported operands.
Steps to reproduce the behavior:
Code before refactoring:
structure
-- main
---- blob.py
-- test
---- test.py
blob.py:
classBaseBlob(object):
def__init__(self, text):
self.raw=textdef_cmpkey(self):
returnself.rawdef_compare(self, other, method):
try:
returnmethod(self._cmpkey(), other._cmpkey())
except (AttributeError, TypeError):
returnNotImplementeddef__eq__(self, other):
returnself._compare(other, lambdas, o: s==o)
def__add__(self, other):
ifisinstance(other, (str, bytes)):
returnself.__class__(self.raw+other)
elifisinstance(other, BaseBlob):
returnself.__class__(self.raw+other.raw)
else:
raiseTypeError('Operands must be either strings or {0} objects'
.format(self.__class__.__name__))
classTextBlob(BaseBlob):
pass
Rename Method refactoring is allowed to change the name of methods designed to emulate numeric operations.
It would be nice if Rope sent an alert, as this transformation may cause type errors regarding unsupported operands.
Steps to reproduce the behavior:
structure
blob.py:
test.py:
The text was updated successfully, but these errors were encountered: