[Python-checkins] r59858 - python/trunk/Doc/library/_winreg.rst

georg.brandl python-checkins at python.org
Tue Jan 8 17:18:26 CET 2008


Author: georg.brandl
Date: Tue Jan  8 17:18:26 2008
New Revision: 59858

Modified:
   python/trunk/Doc/library/_winreg.rst
Log:
Fix markup errors from r59857 and clarify key.__enter__/__exit__ docs


Modified: python/trunk/Doc/library/_winreg.rst
==============================================================================
--- python/trunk/Doc/library/_winreg.rst	(original)
+++ python/trunk/Doc/library/_winreg.rst	Tue Jan  8 17:18:26 2008
@@ -136,11 +136,11 @@
 .. function:: ExpandEnvironmentStrings(unicode)
 
    Expands environment strings %NAME% in unicode string like const:`REG_EXPAND_SZ`::
-   
-   >>> ExpandEnvironmentStrings(u"%windir%")
-   u"C:\\Windows"
-   
-   .. versionadded: 2.6
+
+      >>> ExpandEnvironmentStrings(u"%windir%")
+      u"C:\\Windows"
+
+   .. versionadded:: 2.6
 
 
 .. function:: FlushKey(key)
@@ -429,10 +429,15 @@
    underlying Win32 handle to exist beyond the lifetime  of the handle object.
 
 .. method:: PyHKEY.__enter__()
-.. method:: PyHKEY.__exit__(*exc_info)
-   
-   The HKEY object implements __enter__ and __exit__ and thus supports the 
-   context protocol for the with statement.
-   
-   .. versionadded: 2.6
+            PyHKEY.__exit__(\*exc_info)
+
+   The HKEY object implements :meth:`__enter__` and :meth:`__exit__` and thus
+   supports the context protocol for the :keyword:`with` statement::
+
+      with OpenKey(HKEY_LOCAL_MACHINE, "foo") as key:
+          # ... work with key ...
+
+   will automatically close *key* when control leaves the :keyword:`with` block.
+
+   .. versionadded:: 2.6
 


More information about the Python-checkins mailing list