I've gotten used to writing functions that work like this:
def f():
if sunny:
return
#do non-sunny stuff
I'm trying to figure out the equivalent syntax to use within a module. I want to do something like this:
if sunny:
import tshirt
#do something here to skip the rest of the file
import raincoat
import umbrella
#continue defining the module for non-sunny conditions
I know I can write this as an if/else
but it seems silly to indent the entire rest of my module.
I could move the rest of the code into a separate module and conditionally import it, but that seems painful.