mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-32467: Let collections.abc.ValuesView inherit from Collection (#5152)
This commit is contained in:
parent
782d6fe443
commit
02556fbade
4 changed files with 6 additions and 4 deletions
|
@ -843,13 +843,13 @@ class TestOneTrickPonyABCs(ABCTestCase):
|
|||
self.assertFalse(issubclass(type(x), Collection), repr(type(x)))
|
||||
# Check some non-collection iterables
|
||||
non_col_iterables = [_test_gen(), iter(b''), iter(bytearray()),
|
||||
(x for x in []), dict().values()]
|
||||
(x for x in [])]
|
||||
for x in non_col_iterables:
|
||||
self.assertNotIsInstance(x, Collection)
|
||||
self.assertFalse(issubclass(type(x), Collection), repr(type(x)))
|
||||
# Check some collections
|
||||
samples = [set(), frozenset(), dict(), bytes(), str(), tuple(),
|
||||
list(), dict().keys(), dict().items()]
|
||||
list(), dict().keys(), dict().items(), dict().values()]
|
||||
for x in samples:
|
||||
self.assertIsInstance(x, Collection)
|
||||
self.assertTrue(issubclass(type(x), Collection), repr(type(x)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue