[PEP Proposal] Assure keyword

Yeah, I proposed safe_cast here. It’s a similar idea as @slobodaapl’s but generalized to types other than NoneType.

If we add assure to typing, I’d name it ensure_non_none or something like that. It should definitely be a function over a keyword since it fits in the function paradigm.

2 Likes