HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · 8 days agoPython needs an actual default functionlemmy.mlexternal-linkmessage-square160fedilinkarrow-up1756arrow-down129file-text
arrow-up1727arrow-down1external-linkPython needs an actual default functionlemmy.mlHiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · 8 days agomessage-square160fedilinkfile-text
Also, do y’all call main() in the if block or do you just put the code you want to run in the if block?
minus-squareEager Eagle@lemmy.worldlinkfedilinkEnglisharrow-up35·8 days agoThe if block is still in the global scope, so writing the code in it is a great way to find yourself scratching your head with a weird bug 30 minutes later.
minus-squarebenni@lemmy.worldlinkfedilinkarrow-up1·2 days agoInteresting observation. Can you give an example where this is relevant?
The
if
block is still in the global scope, so writing the code in it is a great way to find yourself scratching your head with a weird bug 30 minutes later.Interesting observation. Can you give an example where this is relevant?