minus-squarechrismit3s@feddit.detoPython@programming.dev•Python errors as valueslinkfedilinkarrow-up6·11 months agoIf you wrote the type signature of get_user as tuple[User, None] | tuple[None, Exception], the assertion would not be necessary and the type checker wouldn’t complain. linkfedilink
minus-squarechrismit3s@feddit.detoProgramming@programming.dev•Return Generic Type in Rustlinkfedilinkarrow-up3·11 months agoWell how do you want to use said get function? let x = config.get("key").await; So what type should x have? linkfedilink
If you wrote the type signature of
get_user
astuple[User, None] | tuple[None, Exception]
, the assertion would not be necessary and the type checker wouldn’t complain.