hukkin/tomli-w

Improve error message for ill formed toml key

Closed this issue · 1 comments

tomli_w.dumps({"1": 1}) works fine, but when the key is numeric, such as passing in {1:1} I get a TypeError about iterability. The error message is pretty hard to decipher. Similarly if I pass in None as the key the complaint is about not being subscriptable. I think these errors could be improved with a type check and be better reported.

Thanks for the issue! I've improved the error message in #62