[Python-Dev] cpython: Issue #12469: replace assertions by explicit if+raise

Gregory P. Smith greg at krypto.org
Mon Jul 4 19:48:45 CEST 2011


On Mon, Jul 4, 2011 at 9:23 AM, Antoine Pitrou <solipsis at pitrou.net> wrote:

> On Mon, 04 Jul 2011 18:06:53 +0200
> victor.stinner <python-checkins at python.org> wrote:
> > http://hg.python.org/cpython/rev/7eef821ab20d
> > changeset:   71197:7eef821ab20d
> > user:        Victor Stinner <victor.stinner at haypocalc.com>
> > date:        Mon Jul 04 18:06:35 2011 +0200
> > summary:
> >   Issue #12469: replace assertions by explicit if+raise
>
> Instead of generic Exception, it would be better to use AssertionError.
>

or in many cases given this was in unittests... use the self.assertFoo
methods and avoid assert and if statements all together.


>
> Regards
>
> Antoine.
>
>
> _______________________________________________
> Python-Dev mailing list
> Python-Dev at python.org
> http://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe:
> http://mail.python.org/mailman/options/python-dev/greg%40krypto.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20110704/8d45bc7d/attachment.html>


More information about the Python-Dev mailing list