]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Removed the usage of the "collections.MutableMapping"
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 28 Apr 2011 16:10:24 +0000 (12:10 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 28 Apr 2011 16:10:24 +0000 (12:10 -0400)
abc from the ext.mutable docs as it was being used
incorrectly and makes the example more difficult
to understand in any case.  [ticket:2152]

CHANGES
lib/sqlalchemy/ext/mutable.py

diff --git a/CHANGES b/CHANGES
index b6927eda1f3be5b34d7faa3bb6c3e7381cf030f5..622451ca855a2ba3ddf1d7f3d8e5a4f1df84e0fe 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -61,6 +61,12 @@ CHANGES
   - Fixed the psycopg2_version parsing in the 
     psycopg2 dialect.
 
+- documentation
+  - Removed the usage of the "collections.MutableMapping"
+    abc from the ext.mutable docs as it was being used
+    incorrectly and makes the example more difficult
+    to understand in any case.  [ticket:2152]
+
 - examples
   - removed the ancient "polymorphic association"
     examples and replaced with an updated set of
index 9be559d04f42311776629c7ae300320bcfd6dfd3..d14cfe3c0f11466bf0edd7907f4445486440458e 100644 (file)
@@ -56,7 +56,7 @@ the :class:`.Mutable` mixin::
     import collections
     from sqlalchemy.ext.mutable import Mutable
 
-    class MutationDict(Mutable, collections.MutableMapping, dict):
+    class MutationDict(Mutable, dict):
         @classmethod
         def coerce(cls, key, value):
             "Convert plain dictionaries to MutationDict."
@@ -83,11 +83,11 @@ the :class:`.Mutable` mixin::
             self.changed()
 
 The above dictionary class takes the approach of subclassing the Python
-built-ins ``collections.MutableMapping`` and ``dict`` to produce a dict
+built-in ``dict`` to produce a dict
 subclass which routes all mutation events through ``__setitem__``. There are
 many variants on this approach, such as subclassing ``UserDict.UserDict``,
-etc. The part that's important to this example is that the
-:meth:`.Mutable.changed` method is called whenever an in-place change to the
+the newer ``collections.MutableMapping``,  etc. The part that's important to this 
+example is that the :meth:`.Mutable.changed` method is called whenever an in-place change to the
 datastructure takes place.
 
 We also redefine the :meth:`.Mutable.coerce` method which will be used to
@@ -193,7 +193,7 @@ stream::
 With our dictionary example, we need to return the contents of the dict itself
 (and also restore them on __setstate__)::
 
-    class MutationDict(Mutable, collections.MutableMapping, dict):
+    class MutationDict(Mutable, dict):
         # ....
 
         def __getstate__(self):