Meaning of digits after NaN in Python Decimal object
<p>I was reading the lexical definition for valid decimal string syntax in the documentation for <a href="http://docs.python.org/library/decimal.html#decimal.Decimal" rel="nofollow"><code>decimal.Decimal</code></a> and the following struck me as kind of odd:</p>

<pre><code>nan            ::=  'NaN' [digits] | 'sNaN' [digits]
</code></pre>

<p>This looked really strange to me, but apparently digits can be included after 'NaN' without any issues, but any character besides digits after 'NaN' raises <code>InvalidOperation</code>.</p>

<pre><code>&gt;&gt;&gt; Decimal('NaN10')
Decimal('NaN10')
</code></pre>

<p>So I have a few questions about this:</p>

<ol>
<li>What is the meaning of digits that are a part of <code>NaN</code>?</li>
<li>How do instances of <code>NaN</code> with digits behave differently than a "normal" <code>NaN</code>?</li>
<li>Are there ways to obtain a <code>NaN</code> with digits besides initializing it that way?</li>
<li>Are there other places in Python besides the <code>Decimal</code> class where <code>NaN</code> can be followed by digits?</li>
</ol>

<p>Thanks!</p>
