diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-06-09 23:08:13 (GMT) |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2009-06-09 23:08:13 (GMT) |
commit | 901f200c81599116e3dc6ffe32b66509bcaf17ce (patch) | |
tree | c7c7ae9ddb7d7ba1ae1e6b662e2b328d6bae3808 /Doc | |
parent | 03dcc73c1121ebccc49af4cb5ff2d4aa8ca833db (diff) | |
download | cpython-901f200c81599116e3dc6ffe32b66509bcaf17ce.zip cpython-901f200c81599116e3dc6ffe32b66509bcaf17ce.tar.gz cpython-901f200c81599116e3dc6ffe32b66509bcaf17ce.tar.bz2 |
#6201: Fix test_winreg on Windows:
since the introduction of the SETUP_WITH opcode,
__enter__ and __exit__ methods must belong to the type,
and are not retrieved at the instance level (__dict__ or __getattr__).
Add a note in whatsnew about this incompatibility;
old style classes are not affected.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/whatsnew/2.7.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Doc/whatsnew/2.7.rst b/Doc/whatsnew/2.7.rst index df7601f..01dcc9f 100644 --- a/Doc/whatsnew/2.7.rst +++ b/Doc/whatsnew/2.7.rst @@ -669,7 +669,11 @@ Porting to Python 2.7 This section lists previously described changes and other bugfixes that may require changes to your code: -To be written. +* Because of an optimization for the :keyword:`with` statement, the special + methods :meth:`__enter__` and :meth:`__exit__` must belong to the object's + type, and cannot be directly attached to the object's instance. This + affects new-styles classes (derived from :class:`object`) or C extension + types. (:issue:`6101`.) .. ====================================================================== |