Buon pome.
Nell'help di list.sort, Python 2.7, leggo:

    L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
    cmp(x, y) -> -1, 0, 1

Ma cmp, che può assumere -1, 0 o 1 come valori, cos'è, a cosa serve?

Cmp sta per compara? Compara cosa?

Gabriele.
_______________________________________________
Python mailing list
Python@lists.python.it
https://lists.python.it/mailman/listinfo/python

Rispondere a