Isnt len(literal.args)==1 redundant for Not? If Not is passed more than one argument, it morphs to a list anyways. Moreover, do you think True and False should also be considered as literals?