As specified in the python sets documentation: "sets do not implement the __cmp__() method" and "all of the following return False: a<b, a==b, or a>b". Since what we want is to test if used templates are not all in assigned templates list, I believe it's ok to leave it this way.