Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Even more compatibility fixes
  • Loading branch information
ilevkivskyi committed Apr 24, 2017
commit 9e7b6740616afe44a9a9b872fe130373f9fee6a8
11 changes: 6 additions & 5 deletions src/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1047,12 +1047,13 @@ class C(typing.Sequence[T], Protocol[T]): x = 1
self.assertEqual(frozenset(C[int]._get_protocol_attrs()),
frozenset({'__reversed__', '__contains__', '__getitem__',
'__len__', '__iter__', 'count', 'index', 'x'}))
# We use superset, since Python 3.2 does not have 'clear'
class C(typing.MutableSequence[T], Protocol[T]): x = 1
self.assertEqual(frozenset(C[int]._get_protocol_attrs()),
frozenset({'__reversed__', '__contains__', '__getitem__',
'__len__', '__iter__', '__setitem__', '__delitem__',
'__iadd__', 'count', 'index', 'extend', 'clear',
'insert', 'append', 'remove', 'pop', 'reverse', 'x'}))
self.assertTrue(frozenset(C[int]._get_protocol_attrs()) >=
frozenset({'__reversed__', '__contains__', '__getitem__',
'__len__', '__iter__', '__setitem__', '__delitem__',
'__iadd__', 'count', 'index', 'extend', 'insert',
'append', 'remove', 'pop', 'reverse', 'x'}))
class C(typing.Mapping[T, int], Protocol[T]): x = 1
# We use superset, since some versions also have '__ne__'
self.assertTrue(frozenset(C[int]._get_protocol_attrs()) >=
Expand Down
1 change: 0 additions & 1 deletion src/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1805,7 +1805,6 @@ class AsyncIterable(Generic[T_co], extra=collections_abc.AsyncIterable):
class AsyncIterator(AsyncIterable[T_co],
extra=collections_abc.AsyncIterator):
__slots__ = ()
_is_protocol = True

__all__.append('AsyncIterable')
__all__.append('AsyncIterator')
Expand Down