CKTIS / Python
Operatore is not
Restituisce True per oggetti distinti, anche se i valori sono uguali.
Versione: Python 3.14; repository image, production runtime not attested
Sintassi
left is not rightRestituisce True per oggetti distinti, anche se i valori sono uguali.
Una copia di lista ha identità propria; assegnare un secondo nome alla stessa lista conserva l’identità. __ne__ non interviene.
Sintassi
left is not right
is not · id(object)
Esempio di utilizzo
a = []; b = a; c = a.copy()
a is not b → False
a is not c → True
Esempi
records = [8]
alias = records
print(list(records) is not records)
print(alias is not records)
Risultato
True False
__ne__ non interviene.