Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
muffix828ySo you're blaming the language for doing what you told it to? Plus, setters other than setattr are pretty much the most unpythonic things there are.
-
Unit testing (unittest & pytest) has saved me more often than I'm willing to admit.
Any function will take a bit more time to write because you need to add a test with expected inputs and outputs, but it will prevent you from breaking code in the future -- in practice this will save you incredible amounts of time. If you have a commercial app, it can even be worth it to hook it into deployment pipelines like jenkins or codeship, so you will never deploy broken code to a production/build server.
Related Rants
sometimes I hate python....
Ive just chased down a bug where a simple string saved in a simple dict sometimes came out as a f*cking tuple(!) when I needed it!
turned out that at some point this dict got updated with values from some other dict. And at some other point, I decided it was a great idea to rewrite that update code into individual setter's instead ... and of course forgot to remove one the trailing comma's, thus creating a perfectly legal tuple .... *sigh*
No errors, no warnings - just plain corrupt data....
undefined
python