On 4/23/06, Nick Coghlan <[EMAIL PROTECTED]> wrote: > - contextlib.contextmanager() > - is actually used to define contexts according to the current docs > - but returns a GeneratorContextManager object
You may just be trying to avoid overcomplicating things by adding too much detail here, but you have missed my point about contextmanager - it's used in two, distinct, ways: 1. On a simple function, to define a context manager (that's fine, and in line with the docs) 2. On a __context__ method to define a "function that returns a context" The sticking point is (2), which is *neither a context, nor a context manager*. Purely by coincidence, a context manager will do here, but it's more than is needed. So I still believe that you need 2 separate decorators here (no matter how much implementation they share). I've not looked at your other examples, as I'm deliberately trying *not* to understand the details any further until I've read your proposed docs... Paul. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com