[Python-ideas] Efficient debug logging

Stephen J. Turnbull turnbull.stephen.fw at u.tsukuba.ac.jp
Sun Feb 19 01:13:06 EST 2017

Barry Warsaw writes:
 > On Feb 16, 2017, at 03:20 PM, M.-A. Lemburg wrote:
 > >I know some people will disagree, but IMO using "assert" is the wrong
 > >approach in such situations - it's meant for development and testing
 > >only, not as short-cut to avoid having to write a proper error
 > >handler :-)
 > I use assertions for "things that can never happen", although sometimes they
 > do due to an incomplete understanding of the code, the problem, or the
 > environment.

We could interpret that to mean you don't consider that code is ever
out of "development and testing" phase, although it's good enough to
install in production.  I think that is a good philosophy, and I don't
see it as a contradiction of what MAL wrote.

More information about the Python-ideas mailing list