On Fri, May 7, 2010 at 8:38 PM, James Mills <prolo...@shortcircuit.net.au>wrote:

> On Sat, May 8, 2010 at 12:04 PM, Vincent Davis 
> <vinc...@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
>

I know but there are such nice asserts in unittest, but should (I assume
can) they only be used in a unittest or would it be ok to use in code like
the "normal" assert?



*Vincent Davis
720-301-3003 *
vinc...@vincentdavis.net
 my blog <http://vincentdavis.net> |
LinkedIn<http://www.linkedin.com/in/vincentdavis>
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to