Commits

Hong Minhee  committed e5b25cf

Close #1: .copy() dicts

  • Participants
  • Parent commits 94d7f7d

Comments (0)

Files changed (2)

File typequery.py

 
         """
         method = type(self)(name)
-        method.functions = self.functions
-        method.abcs = self.abcs
+        method.functions = self.functions.copy()
+        method.abcs = self.abcs.copy()
         return method
 
     def __contains__(self, cls):

File typequery_tests.py

         skip('This Python implementation/version does not have abc module')
     im3 = im2.clone('im3')
     assert im3({}) == 'mapping {}'
+    im4 = im3.clone('im4')
+    @im4.of(dict)
+    def im4_dict(value):
+        return 'dict ' + repr(value)
+    assert im3({}) == 'mapping {}'
+    assert im4({}) == 'dict {}'
 
 
 def test_abc():