Throwing a TypeError when a non-iterable object is provided.
Throw a TypeError if the iterator is not a function.
Merge pull request #5 from ljharb/type_checking

Type checking