def nconflicts(self, var, val, assignment):
<EOL>def conflict(var2):<EOL><INDENT>return (var2 in assignment<EOL>and not self.constraints(var, val, var2, assignment[var2]))<EOL><DEDENT>return count_if(conflict, self.neighbors[var])<EOL>
Return the number of conflicts var=val has with other variables.