File size: 179 Bytes
831e835
 
 
 
 
1
2
3
4
5
6
def slim_history(hist, keep=12):
    """Mantém histórico curto pra evitar overflow."""
    if len(hist) > keep:
        return [hist[0]] + hist[-(keep-1):]
    return hist