Today I Learned

2023/02/08

rust python

That in Rust, assert! runs in both debug and release builds. For debug-only assertions, use debug_assert!. See https://doc.rust-lang.org/stable/std/macro.debug_assert.html.


That in Python, you can call isinstance(thing, (tuple, OfMany, DifferentClasses)) to check if a variable is an instance of many possible classes. See https://docs.python.org/3/library/functions.html?highlight=isinstance#isinstance.