Phillip J. Eby wrote:
> At 12:08 AM 4/26/2006 +1000, Nick Coghlan wrote:
>> Secondly, the documentation now shows an example
>> of a class with a close() method using contextlib.closing directly as
>> its own
>> __context__() method.
>
> Sadly, that would only work if closing() were a function. Classes don't
> get turned into methods, so you'll need to change that example to use:
>
> def __context__(self):
> return closing(self)
>
> instead.
D'oh! I'll fix the example :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com