HootinNHollerin@lemmy.dbzer0.com to Engineering Memes@lemmy.worldEnglish · edit-21 day agoGet Datedlemmy.dbzer0.comimagemessage-square53fedilinkarrow-up1651arrow-down112
arrow-up1639arrow-down1imageGet Datedlemmy.dbzer0.comHootinNHollerin@lemmy.dbzer0.com to Engineering Memes@lemmy.worldEnglish · edit-21 day agomessage-square53fedilink
minus-squaretetris11@lemmy.mllinkfedilinkEnglisharrow-up3arrow-down1·edit-212 hours agofunction validate(val) try: cast val as numeric except: print "Oops, not a number" cast val as general ## date or whatever end validate(12.5) ## returns 12.5 validate("12.5") ## returns 12.5 validate("12 . 5") ## returns a date maybe
minus-squarePoolloverNathan@programming.devlinkfedilinkEnglisharrow-up3·edit-28 hours agoOh my god what cursed Python, Lua, and SQL offshoot is this
function validate(val) try: cast val as numeric except: print "Oops, not a number" cast val as general ## date or whatever end validate(12.5) ## returns 12.5 validate("12.5") ## returns 12.5 validate("12 . 5") ## returns a date maybe
Oh my god what cursed Python, Lua, and SQL offshoot is this
It’s my own grammar, “Luanatic”