<p>My <a href="https://english.stackexchange.com/questions/19967/what-does-google-fu-mean">Google-fu</a> has failed me.</p>

<p>In Python, are the following two tests for equality equivalent?</p>

<pre><code>n = 5
# Test one.
if n == 5:
    print 'Yay!'

# Test two.
if n is 5:
    print 'Yay!'
</code></pre>

<p>Does this hold true for objects where you would be comparing instances (a <code>list</code> say)?</p>

<p>Okay, so this kind of answers my question:</p>

<pre><code>L = []
L.append(1)
if L == [1]:
    print 'Yay!'
# Holds true, but...

if L is [1]:
    print 'Yay!'
# Doesn't.
</code></pre>

<p>So <code>==</code> tests value where <code>is</code> tests to see if they are the same object?</p>

```
==
```
determines if the values are equal, while
```
is
```
determines if they are the exact same object.