#Km91#@sh.itjust.works to TenForward: Where Every Vulcan Knows Your Name@lemmy.world · 2 years agoMachine learningsh.itjust.worksimagemessage-square38linkfedilinkarrow-up1547arrow-down111
arrow-up1536arrow-down1imageMachine learningsh.itjust.works#Km91#@sh.itjust.works to TenForward: Where Every Vulcan Knows Your Name@lemmy.world · 2 years agomessage-square38linkfedilink
minus-squareArtVandelay@lemmy.worldlinkfedilinkEnglisharrow-up10arrow-down1·edit-22 years agodef hot(temp: int = 340): return temp That way Bev can define temp however she needs, but if Picard doesn’t specify, he gets his tea at a nice drinkable Kelvin temp.
minus-squareWhiskyTangoFoxtrot@lemmy.worldlinkfedilinkarrow-up4·2 years agoShouldn’t that be a float?
minus-squareArtVandelay@lemmy.worldlinkfedilinkEnglisharrow-up8·2 years agoPython is dynamically typed, so you could just go against the type hint like an animal. But yes, probably.
minus-squarewatersnipje@lemmy.blahaj.zonelinkfedilinkarrow-up1arrow-down1·2 years agoIf you want to write Python like a caveman, then sure
def hot(temp: int = 340): return tempThat way Bev can define temp however she needs, but if Picard doesn’t specify, he gets his tea at a nice drinkable Kelvin temp.
Shouldn’t that be a float?
Python is dynamically typed, so you could just go against the type hint like an animal. But yes, probably.
If you want to write Python like a caveman, then sure