Missing the point of loose languages
Missing the point of loose languages
Posted Dec 21, 2021 18:55 UTC (Tue) by tbelaire (subscriber, #141140)In reply to: Missing the point of loose languages by rdeforest
Parent article: Wrangling the typing PEPs
Until I started annotating with types, I was dealing with "Oh, that's a bytes regex, doesn't work on str", on line xxx. And other errors, where as being careful and making sure the encoding/decoding happened exactly once, and using the types to check that across all the functions and not playing wack-a-mole with errors is so much nicer.
And when I'm working with pandas, I do want to know if I have a DF with only one column vs a Series, as the operations are different, but it's just `df['col'] ` vs `df[['col']]` to get each one. (I think). So I already need to check and keep the types separate, why not ask the compiler for help?