title: Python type definitions with space or special chars
body: <p>I have a python 3.8 routine intended to add typing to a CSV file with headers, as follows:</p>
  
  <pre><code>class Record(NamedTuple):
      """ Define the fields and their types in a record. """
      Category : str
      Item : str
      Serving Size :  str
      Calories : int
      SaturatedFat(%pctDaily) : int
      Sugars : int
      Protein : int
  
      @classmethod
      def _transform(cls: 'Record', dct: dict) -&gt; dict:
          """ Convert string values in given dictionary to corresponding Record
              field type.
          """
          return {field: cls._field_types[field](value)
                      for field, value in dct.items()}
  </code></pre>
  
  <p>What I've discovered is that any header field containing spaces or special characters will error out with e.g.,     </p>
  
  <pre><code>Saturated(%Fat) : float
                ^
  SyntaxError: invalid syntax
  </code></pre>
  
  <p>Any ideas how to solve this?
  TIA,
  Alex</p>