Quantcast
Channel: Catching exceptions in else - Stack Overflow
Browsing all 2 articles
Browse latest View live

Answer by Martijn Pieters for Catching exceptions in else

Your logic is rather.. involved. If you want to test if at least one of those variables is not None, then use any():debug.assert(any(v is not None for v in (data, id, time, group)))any() iterates over...

View Article


Catching exceptions in else

Is this a good pythonic way to test something for equality, and catch exceptions in else?try: # Check for equality debug.assert_eq(data, None) debug.assert_eq(id, None) debug.assert_eq(time, None)...

View Article
Browsing all 2 articles
Browse latest View live