File tree Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Expand file tree Collapse file tree 4 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 22 from ._map import Map
33except ImportError :
44 from .map import Map
5+ else :
6+ import collections .abc as _abc
7+ _abc .Mapping .register (Map )
58
69
710__all__ = 'Map' ,
Original file line number Diff line number Diff line change @@ -3032,7 +3032,7 @@ static PyMappingMethods Map_as_mapping = {
30323032
30333033PyTypeObject _Map_Type = {
30343034 PyVarObject_HEAD_INIT (NULL , 0 )
3035- "Map" ,
3035+ "immutables._map. Map" ,
30363036 sizeof (MapObject ),
30373037 .tp_methods = Map_methods ,
30383038 .tp_as_mapping = & Map_as_mapping ,
Original file line number Diff line number Diff line change 1+ import collections .abc
12import reprlib
23
34
@@ -457,3 +458,6 @@ def __dump__(self):
457458 buf = []
458459 self .__root .dump (buf , 0 )
459460 return '\n ' .join (buf )
461+
462+
463+ collections .abc .Mapping .register (Map )
Original file line number Diff line number Diff line change 1+ import collections .abc
12import gc
23import random
34import unittest
@@ -795,6 +796,9 @@ def test_hash_2(self):
795796 with HaskKeyCrasher (error_on_hash = True ):
796797 hash (m )
797798
799+ def test_abc_1 (self ):
800+ self .assertTrue (issubclass (self .Map , collections .abc .Mapping ))
801+
798802
799803class PyMapTest (BaseMapTest , unittest .TestCase ):
800804
You can’t perform that action at this time.
0 commit comments