Beginner question: Converting Single-Element tuples to list

Steven Bethard steven.bethard at
Mon Jun 27 23:42:51 EDT 2005

vdavidster at wrote:
>     if type(input) == str:

You might consider writing this as:

     if isinstance(input, basestring):

I don't know if pyparsing ever produces unicode objects, but in case it 
does (or it starts to in the future), isinstance is a better call here.


More information about the Python-list mailing list