cascading python executions only if return code is 0

Tim Chase python.list at tim.thechases.com
Fri Dec 27 03:50:02 CET 2013


On 2013-12-27 12:44, Chris Angelico wrote:
> On Fri, Dec 27, 2013 at 12:37 PM, Roy Smith <roy at panix.com> wrote:
> > In article <mailman.4567.1387819120.18130.python-list at python.org>,
> >  Ethan Furman <ethan at stoneleaf.us> wrote:
> >  
> >> Mostly I don't want newbies thinking "Hey!  I can use assertions
> >> for all my confidence testing!"  
> >
> > How about this one, that I wrote yesterday;
> >
> >         assert second >= self.current_second, "time went
> > backwards"
> >
> > I think that's pretty high up on the "can never happen" list.  
> 
> assert second >= self.current_second, "user changed the clock"

There appears to be a Whovian at the wheel...

>>> from getpass import getuser
>>> getuser()
'doctor4'


Or perhaps a Star Trek fan:

>>> from startrek.movie import episode
>>> episode()
4


It's-clearly-past-my-bedtime-or-is-it-before'ly yers,

-tkc








More information about the Python-list mailing list