title: How do I override Python's 'str' so that it returns a capitalized value?
body: <p>How do I define </p>
  
  <pre><code>class CapStr(str):
      # ...
  </code></pre>
  
  <p>in Python (3.7+) so that all letters in the resulting <code>str</code> subclass are capitalized, e.g.</p>
  
  <pre><code>&gt;&gt;&gt; foo: CapStr = CapStr('aBcd')
  &gt;&gt;&gt; foo
  'ABCD'
  &gt;&gt;&gt; CapStr('wXyZ')
  'WXYZ' 
  </code></pre>