'None' is not displayed as I expected in Python interactive mode
<p>I thought the display in Python interactive mode was always equivalent to <code>print(repr())</code>, but this is not so for <code>None</code>. Is this a language feature or am I missing something? Thank you</p>

<pre><code>&gt;&gt;&gt; None
&gt;&gt;&gt; print(repr(None))
None
&gt;&gt;&gt;
</code></pre>

<p>In Python, a function that does not return anything but is called only for its side effects actually returns None. As such functions are common enough, Python interactive interpreter does not print anything in that case. By extension, it does not print anything when the interactive expression evaluates to None, even if it is not a function call.</p>

<p>If can be misleading for beginners because you have </p>

<pre><code>&gt;&gt;&gt; a = 1
&gt;&gt;&gt; a
1
&gt;&gt;&gt;
</code></pre>

<p>but </p>

<pre><code>&gt;&gt;&gt; a = None
&gt;&gt;&gt; a
&gt;&gt;&gt;
</code></pre>

<p>but is is indeed <em>by design</em></p>

python