]> granicus.if.org Git - python/commitdiff
Close #14386: Register types.MappingProxyType as a Mapping
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 19 Apr 2012 23:41:36 +0000 (01:41 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 19 Apr 2012 23:41:36 +0000 (01:41 +0200)
Lib/collections/abc.py

index 37a813abdae26fa63a74b66e95f88dd52d2a4dc1..d17cfdcd9b2d67fef70d853db1004dc219699fe7 100644 (file)
@@ -43,7 +43,7 @@ dict_keys = type({}.keys())
 dict_values = type({}.values())
 dict_items = type({}.items())
 ## misc ##
-dict_proxy = type(type.__dict__)
+mappingproxy = type(type.__dict__)
 
 
 ### ONE-TRICK PONIES ###
@@ -405,6 +405,8 @@ class Mapping(Sized, Iterable, Container):
     def __ne__(self, other):
         return not (self == other)
 
+Mapping.register(mappingproxy)
+
 
 class MappingView(Sized):