title: Is it possible to know the maximum number accepted by chr using Python?
body: <p>From the Python's documentation of the <a href="https://docs.python.org/3.5/library/functions.html#chr" rel="noreferrer"><code>chr</code></a> built-in function, the maximum value that <code>chr</code> accepts is 1114111 (in decimal) or 0x10FFFF (in base 16). And in fact</p>
  
  <pre><code>&gt;&gt;&gt; chr(1114112)
  Traceback (most recent call last):
    File "&lt;pyshell#20&gt;", line 1, in &lt;module&gt;
      chr(1114112)
  ValueError: chr() arg not in range(0x110000)
  </code></pre>
  
  <p>My first question is the following, why exactly that number? The second question is: if this number changes, is it possible to know from a Python command the maximum value accepted by <code>chr</code>?</p>