Closed jtratner closed 10 years ago
cc @alefnula
want to submit a PR for this?
@jreback No problem, just tell me which exception is the most reasonable one?
assert isinstance(colspec, (tuple, list)) # TypeError
assert len(colspec) == 2 # ValueError
assert isinstance(colspec[0], int) # TypeError
?
yep those look good
@jreback This is fixed on master.
gr8 I should have looked!
AssertionError bubbling up to the user - ruroh:
Ends up with an AssertionError:
Low priority but we should fix at some point. Really could be as simple as this in
read_fwf
.if not all(isinstance(colspec, (tuple, list) and len(colspec) == 2 and isinstance(colspec[0], int) for colspec in colspecs): raise ValueError("colspecs must be 2-tuples of integers")