Closed fawkesley closed 11 years ago
Okay, I agree. How about we call it setup()
, and write from scraperwiki.runlog import setup; setup()
?
Here's a good example of the rant I wanted paul to find yesterday: http://www.plope.com/Members/chrism/import_time_side_effects
Memorable quote: "keep it to yourself and wash your hands afterwards".
Nice rant, like it. S'long as I can alternatively run import scraperwiki; scraperwiki.runlog.setup()
then I'm happy with @pwaller's proposed solution.
On further thought, it's devious that just importing something should have a side effect. An explicit activation call would be more polite.
Not least because it breaks my PEP8 checker due to it being an "unused" import!
It's very non-standard (I have never seen an import "doing" stuff before) and therefore it's a trap for the unwary. I can imagine the "fun" that will ensue when someone carelessly copy / pastes a load of imports, "knowing" that it's safe to do so.