On Tue, Aug 3, 2010 at 12:05 AM, David Hutto <smokefl...@gmail.com> wrote: > On Mon, Aug 2, 2010 at 8:53 PM, Richard D. Moores <rdmoo...@gmail.com> wrote: >> On Mon, Aug 2, 2010 at 16:57, Steven D'Aprano <st...@pearwood.info> wrote: >>> # File *probably* doesn't exist. Consider better error checking. >> >> Steve, before I dig into your detailed reply, please tell me what you >> meant by " # File *probably* doesn't exist. Consider better error >> checking.". > > > He was referring to the uncertainty principle that applies to all man > and life, ain't that right stephan?...*wink*, *wink*, *nudge*, > *nudge*. >> >> Context was >> >> def load(path): >> """Open file given by path if it exists, and return its contents. >> If it doesn't exist, save and return the default contents. >> """ >> try: >> f = open(path, 'r') >> except IOError: >> # File *probably* doesn't exist. Consider better error checking. >> data = [] >> save(path, data) >> else: >> data = pickle.load(f) >> f.close() >> return data >> >> Dick >> _______________________________________________ >> Tutor maillist - tu...@python.org >> To unsubscribe or change subscription options: >> http://mail.python.org/mailman/listinfo/tutor >>
I know that sometimes, in the darkof night, i say stephan of oracle eternance, please impart to me thy wisdom. And stephan answers with bowels in hand, and relevance upon his tongue he delivers our saving grace. _______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor