throw typeerror if constructor argument is not iterable