A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-April/064337.html below:

[Python-Dev] Updated context management documentation

[Python-Dev] Updated context management documentation [Python-Dev] Updated context management documentationPhillip J. Eby pje at telecommunity.com
Tue Apr 25 17:42:54 CEST 2006
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.

More information about the Python-Dev mailing list

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