On Wed, Apr 19, 2006 at 10:00:21PM +1000, Nick Coghlan wrote: > And the parenthetical comment was completely backwards and should have read: > > (This means that all context managers are contexts, but not all contexts > are > context managers). > > The reason for recommending that context managers should be contexts is > similar to the reason that iterators should be iterables - so that doing > the __context__() call manually will still give you something that can be > used in a with statement. So the intention is to enable something like: ctx = lock.__context__() with ctx: ... Which works as long as people don't try to use the context in two nested 'with' statements. Fair enough. I don't think I'll suggest doing this in the "What's New", though. :) --amk
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4