parent
656db317d2
commit
a6e33abc5f
2 changed files with 12 additions and 2 deletions
|
|
@ -516,7 +516,8 @@ class Value(metaclass=ABCMeta):
|
|||
"""
|
||||
if not isinstance(amount, int):
|
||||
raise TypeError("Rotate amount must be an integer, not {!r}".format(amount))
|
||||
amount %= len(self)
|
||||
if len(self) != 0:
|
||||
amount %= len(self)
|
||||
return Cat(self[-amount:], self[:-amount]) # meow :3
|
||||
|
||||
def rotate_right(self, amount):
|
||||
|
|
@ -534,7 +535,8 @@ class Value(metaclass=ABCMeta):
|
|||
"""
|
||||
if not isinstance(amount, int):
|
||||
raise TypeError("Rotate amount must be an integer, not {!r}".format(amount))
|
||||
amount %= len(self)
|
||||
if len(self) != 0:
|
||||
amount %= len(self)
|
||||
return Cat(self[amount:], self[:amount])
|
||||
|
||||
def eq(self, value):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue