Only check in lists and dictionaries

The "in" operator also works on strings which can cause problems with this line if the attribute and the object are named the same thing.

Signed-off-by: George Sibble <gsibble@gmail.com>