On Saturday, August 1, 2015 at 10:57:19 PM UTC+2, Marko Rauhamaa wrote: > ======================================================================== > def circularly_equal(l1, l2): > length = len(l1) > if length != len(l2): > return False > twice = l1 + l1 > for i in range(length): > if twice[i:i + length] == l2: > return True > return False > ========================================================================
Nice idea! But I actually really need those "canonic rotations", since I'm hashing them somewhere.. Lukas -- https://mail.python.org/mailman/listinfo/python-list