This may be a bit restrictive since it won't work for things that act like lists but aren't (e.g. tuples).