You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is fairly common (often in test code, but also in regular code) to use assertions to encode invariants that are hard/impossible to detect statically. So we should be able to perform type narrowing via assert statements:
deff(x: str|None):
assertxisnotNonereveal_type(x) # Should be 'str'