I must be missing something because this is strange...
a = ['a', 'b', 'c'] a1 = ['b', 'a'] foo = list( set(a) - set(a1))
** returning **
foo == ['c'] type(foo) == <type 'list'> foo == 'c'
** now the strange part **
foo = foo.insert(0, 'z') foo == None
why do list operations like insert, and append cause foo to be None??
the following accomplishes what my top example attempts to but seems ridiculous.
import itertools a = ['a', 'b', 'c'] a1 = ['b', 'a'] foo = list(set(a) - set(a1)) q = [['z']] q.append(foo) q = [i for i in itertools.chain.from_iterable(q)] q == ['z', 'c']
any insight would be appreciated. thank you.