bpo-30144: Import collections ABC from collections.abc rather than collections. (#1263)

This commit is contained in:
Serhiy Storchaka 2017-04-24 09:05:00 +03:00 committed by GitHub
parent 9eb5ca0774
commit 2e576f5aec
22 changed files with 90 additions and 85 deletions

View file

@ -1,4 +1,4 @@
import collections
import collections.abc
import copy
import pickle
import unittest
@ -249,23 +249,23 @@ class DictSetTest(unittest.TestCase):
def test_abc_registry(self):
d = dict(a=1)
self.assertIsInstance(d.keys(), collections.KeysView)
self.assertIsInstance(d.keys(), collections.MappingView)
self.assertIsInstance(d.keys(), collections.Set)
self.assertIsInstance(d.keys(), collections.Sized)
self.assertIsInstance(d.keys(), collections.Iterable)
self.assertIsInstance(d.keys(), collections.Container)
self.assertIsInstance(d.keys(), collections.abc.KeysView)
self.assertIsInstance(d.keys(), collections.abc.MappingView)
self.assertIsInstance(d.keys(), collections.abc.Set)
self.assertIsInstance(d.keys(), collections.abc.Sized)
self.assertIsInstance(d.keys(), collections.abc.Iterable)
self.assertIsInstance(d.keys(), collections.abc.Container)
self.assertIsInstance(d.values(), collections.ValuesView)
self.assertIsInstance(d.values(), collections.MappingView)
self.assertIsInstance(d.values(), collections.Sized)
self.assertIsInstance(d.values(), collections.abc.ValuesView)
self.assertIsInstance(d.values(), collections.abc.MappingView)
self.assertIsInstance(d.values(), collections.abc.Sized)
self.assertIsInstance(d.items(), collections.ItemsView)
self.assertIsInstance(d.items(), collections.MappingView)
self.assertIsInstance(d.items(), collections.Set)
self.assertIsInstance(d.items(), collections.Sized)
self.assertIsInstance(d.items(), collections.Iterable)
self.assertIsInstance(d.items(), collections.Container)
self.assertIsInstance(d.items(), collections.abc.ItemsView)
self.assertIsInstance(d.items(), collections.abc.MappingView)
self.assertIsInstance(d.items(), collections.abc.Set)
self.assertIsInstance(d.items(), collections.abc.Sized)
self.assertIsInstance(d.items(), collections.abc.Iterable)
self.assertIsInstance(d.items(), collections.abc.Container)
if __name__ == "__main__":