HiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · 2 days agoPython needs an actual default functionlemmy.mlexternal-linkmessage-square158fedilinkarrow-up1740arrow-down129file-text
arrow-up1711arrow-down1external-linkPython needs an actual default functionlemmy.mlHiddenLayer555@lemmy.ml to Programmer Humor@programming.devEnglish · 2 days agomessage-square158fedilinkfile-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-squarejjjalljs@ttrpg.networklinkfedilinkarrow-up8·2 days agoCall the function from the if block. Now your tests can more easily call it. I think at my last job we did argument parsing in the if block, and passed stuff into the main function.
Call the function from the if block.
Now your tests can more easily call it.
I think at my last job we did argument parsing in the if block, and passed stuff into the main function.