is there a functional assert(x==y, 'error msg')

James Mills prologic at shortcircuit.net.au
Fri May 7 22:38:25 EDT 2010


On Sat, May 8, 2010 at 12:04 PM, Vincent Davis <vincent at vincentdavis.net>wrote:

> Is there a functional assert(x==y, 'error msg') ?
> I can only find the assert that is used like;
> assert x==y, 'error msg'
>

What about:

def assertfunc(expr, msg):
   assert expr, msg

cheers
James
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100508/8570df38/attachment-0001.html>


More information about the Python-list mailing list