mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix imports from collections.abc
This commit is contained in:
parent
bd475115c4
commit
57d1a887e7
7 changed files with 22 additions and 20 deletions
|
@ -10,12 +10,13 @@ from random import randrange, shuffle
|
|||
import keyword
|
||||
import re
|
||||
import sys
|
||||
from collections import Hashable, Iterable, Iterator
|
||||
from collections import Sized, Container, Callable
|
||||
from collections import Set, MutableSet
|
||||
from collections import Mapping, MutableMapping, KeysView, ItemsView, UserDict
|
||||
from collections import Sequence, MutableSequence
|
||||
from collections import ByteString
|
||||
from collections import UserDict
|
||||
from collections.abc import Hashable, Iterable, Iterator
|
||||
from collections.abc import Sized, Container, Callable
|
||||
from collections.abc import Set, MutableSet
|
||||
from collections.abc import Mapping, MutableMapping, KeysView, ItemsView
|
||||
from collections.abc import Sequence, MutableSequence
|
||||
from collections.abc import ByteString
|
||||
|
||||
TestNT = namedtuple('TestNT', 'x y z') # type used for pickle tests
|
||||
|
||||
|
@ -507,7 +508,7 @@ class TestCollectionABCs(ABCTestCase):
|
|||
|
||||
def test_issue_4920(self):
|
||||
# MutableSet.pop() method did not work
|
||||
class MySet(collections.MutableSet):
|
||||
class MySet(MutableSet):
|
||||
__slots__=['__s']
|
||||
def __init__(self,items=None):
|
||||
if items is None:
|
||||
|
@ -553,7 +554,7 @@ class TestCollectionABCs(ABCTestCase):
|
|||
self.assertTrue(issubclass(sample, Mapping))
|
||||
self.validate_abstract_methods(Mapping, '__contains__', '__iter__', '__len__',
|
||||
'__getitem__')
|
||||
class MyMapping(collections.Mapping):
|
||||
class MyMapping(Mapping):
|
||||
def __len__(self):
|
||||
return 0
|
||||
def __getitem__(self, i):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue