Single string or list of strings in a method
<p>I have run into this several times.  I'm dealing with a lot of methods that can accept a list of strings.  Several times I have accidentally passed a single string and it gets broken apart into a list and each character is used, which isn't the desired behavior.</p>

<pre><code>def test(a,b):
    x = []
    x.extend(a)
    x.extend(b)
    return x

x = [1,2,3,4]
</code></pre>

<p>What I don't want to happen:</p>

<pre><code>test(x,'test')
[1, 2, 3, 4, 't', 'e', 's', 't']
</code></pre>

<p>I have to resort to a strange syntax:</p>

<pre><code>test(x,['list']) 
</code></pre>

<p>I would like these to work implicitly:</p>

<pre><code>test(x,'list')
[1, 2, 3, 4, 'test']

test(x,['one', 'two', 'three'])
[1, 2, 3, 4, 'one', 'two', 'three']
</code></pre>

<p>I really feel like there's a "pythonic" way to do this or something involving duck typing, but I don't see it.  I know I could use isinstance() to check if it's a string, but I feel like there's a better way.</p>

<p><strong>Edit</strong>:  I'm using python 2.4.3</p>
