title: Pyparsing newbie setParseAction modifying tokens
body: <p>I'm new to Pyparsing (and pretty new to Python). I have tried to reduce my problem down to the simplest form that will illustrate what's going wrong (to the point where I probably wouldn't need Pyparsing at all!)</p>
  
  <p>Suppose I've got a string consisting of letters and numbers, such as "b7 z4 a2 d e c3". There's always a letter, but the number is optional. I want to parse this into its individual elements, and then process them, but where there is a bare letter, with no number, it would be handy to change it so that it had the "default" number 1 after it. Then I could process every element in a consistent way. I thought I could do this with a setparseAction, as follows:</p>
  
  <pre><code>from pyparsing import *
  teststring = "a2 b5 c9 d e z"
  expected_letter = Word("ABCDEFGabcdefgzZxy", exact=1)
  expected_number = Word(nums)
  letter_and_number = expected_letter + expected_number
  bare_letter = expected_letter
  bare_letter.setParseAction( lambda s,l,t:  t.append("1") )
  elements =  letter_and_number | bare_letter
  line = OneOrMore(elements)
  print line.parseString(teststring)
  </code></pre>
  
  <p>Unfortunately, the t.append() doesn't do what I'm expecting, which was to add a "1" to the list of parsed tokens. Instead, I get an error: TypeError: 'str' object is not callable.</p>
  
  <p>I'm probably just being really thick, here, but could one of you experts please set me straight.</p>
  
  <p>Thanks</p>
  
  <p>Steve</p>