title: How can I specify the type of a column in a python behave step data table?
body: <p>Assume I have a step defined as follows:</p>
  
  <pre><code> Then I would expect to see the following distribution for Ford
        | engine | doors | color |
        | 2.1L   | 4     | red   |
  </code></pre>
  
  <p>And I have the step implementation that reads the table and does the assert as follows:</p>
  
  <pre><code>@then('I would expect to see the following distribution for {car_type}')
  def step(context, car_type):
      car = find_car_method(car_type)
      for row in context.table:
          for heading in row.headings:
              assertEqual(getattr(car, heading), 
                          row[heading], 
                          "%s does not match. " % heading + \
                          "Found %s" % getattr(car, heading))
  </code></pre>
  
  <p>(I do it like this as this approach allows for adding more fields, but keeping it generic enough for many uses of checking attributes of the car).</p>
  
  <p>When my car object has 4 doors (as an int), it does not match as data table requires that there are '4' doors (as a unicode str).</p>
  
  <p>I could implement this method to check the name of the column and handle it differently for different fields, but then maintenance becomes harder when adding a new field as there is one more place to add it.  I would prefer specifying it in the step data table instead.  Something like:</p>
  
  <pre><code> Then I would expect to see the following distribution for Ford
        | engine | doors:int | color |
        | 2.1L   | 4         | red   |
  </code></pre>
  
  <p>Is there something similar that I can use to achieve this (as this does not work)?</p>
  
  <p>Note that I have cases where I need to create from the data table where I have the same problem.  This make is useless trying to use the type of the 'car' object to determine the type as it is None in that case.</p>
  
  <p>Thank you,</p>
  
  <p>Baire</p>