Quantcast
Browsing latest articles
Browse All 2 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 latest articles
Browse All 2 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>