On 11/12/2014 02:47 PM, Marko Rauhamaa wrote:
Ian Kelly <[email protected]>:Although to be honest I'd rather use something like "raise RuntimeError('Unreachable code reached')" than "assert False" here. If the expectation is that the code will never be executed, then there's no reason to ever optimize it out.Asserts have nothing to do with them being optimized out. Asserts are communication.
Asserts are code that can stop your program. That's a bit more than just communication. And your example of how you use asserts shows a bad way to use them, which has been explained. Apparently you refuse to learn from that, but hopefully somebody else will.
-- ~Ethan~ -- https://mail.python.org/mailman/listinfo/python-list
