Gunter Henriksen <gunterhenrik...@gmail.com> writes:

> 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.

In this case, though, we're talking about a class intended to implement
the context manager API (in addition to other API).

So, following your argument above, we might expect a generic context
manager object to be able to tell us whether we're currently inside that
context or not. Does such a thing exist?

-- 
 \       “If consumers even know there's a DRM, what it is, and how it |
  `\     works, we've already failed.” —Peter Lee, Disney corporation, |
_o__)                                                             2005 |
Ben Finney
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to