When I first started Python, I used is and == interchangeably. Then I learned the hard way that they are very different. == checks if the values are the same. is checks if they are the exact same object in memory. a = [1, 2, 3] b = [1, 2, 3] print(a == b) print(a is b) Always use == unless you are specifically checking for None (like if x is... Weiterlesen: The Difference Between is and == in Python
Intelligence View
⚡ tsecurity.de Intelligence
The Difference Between is and == in Python
When I first started Python, I used is and == interchangeably. Then I learned the hard way that they are very different. == checks if the values are the same.…
Quelle & Fakten · 1 Min. Lesezeit
Quelle: DEV Community (dev.to)
Rubrik: Programmazione sicura
Information ergänzen Fachhinweis, Update, Korrektur oder Quelle zur Meldung beitragen
Community-Hinweise zur Meldung
Briefing di sicurezza Gratuito · disdetta in 1 clic
Intelligence Digest — gratuito
Ogni giorno le notizie di sicurezza più importanti · annullabile in qualsiasi momento
💬 Discussione della community e commenti
Avvia la discussione nel flusso broadcast della Social Chat oppure invia qui sopra un contributo esperto tramite il modulo di integrazione.