↧
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 ArticleCatching 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
More Pages to Explore .....