MRAB <goo...@mrabarnett.plus.com> writes:

> Gunter Henriksen wrote:
> > If there is a function which triggers a one-shot switch, I like to
> > have a way to find out if it has already been triggered, I prefer to
> > have the function tell me if it triggered the switch or not, but I
> > would not want that to be by raising an exception.
> 
> The 'file' class also has a 'closed' method, so that's a good model to
> follow.

Yes, I find that convincing as well. (I might prefer it to instead
answer the question “is it currently open?”, i.e. an ‘opened’ query,
but that makes for more awkward English than ‘closed’.)

-- 
 \           “Are you thinking what I'm thinking, Pinky?” “Uh... yeah, |
  `\     Brain, but where are we going to find rubber pants our size?” |
_o__)                                           —_Pinky and The Brain_ |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to