#!/usr/bin/env python # -*- coding: utf8 -*- """Plus rapide""" def simplify(l): if not isinstance(l, list): return l if len(l) == 1: return simplify(l[0]) else: return [simplify(i) for i in l] def toprefix(l): if not isinstance(l, list): return l op=l[1] args=[toprefix(i) for i in l if i!=op] return [op]+args def prioritize(l): if not isinstance(l, list): return l l=simplify(l) for c in ['!=', '=', '&', '|']: i=0 while i