Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I write assert(a==1) right before the line where a is assumed to be 1 (to skip a division by a) even if I know it's 1. Especially if I know it's 1!


The assertion here is not about implementation logic. GP presumably has in mind unit tests, specifically in a framework where the test logic is implemented with such assertions. (For the Python ecosystem, pytest is pretty much standard, and works that way.)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: