On 24 Ago, 12:43, "Fredrik Johansson"
Hi,
It happens that I'm just interested in whether an expression raises an exception, not the return value. This might look something like
try: check_status() except IOError: cleanup()
which could be written more simply as
if check_status() raises IOError: cleanup()
Also, instead of the inconvenient
self.assertRaises(ZeroDivisionError, lambda: 1/0)
one could just write
assert 1/0 raises ZeroDivisionError
Something like this would especially be useful for those of us who aren't fans of the unittest framework. Alternatively, just the assert--raises form could be permitted.
Thoughts?
Fredrik _______________________________________________ Python-ideas mailing list Python-id...@python.orghttp://mail.python.org/mailman/listinfo/python-ideas
+1, I really like it. --- Giampaolo http://code.google.com/p/pyftpdlib/