Visitar URL original
gh-91896: Improve visibility of `ByteString` deprecation warnings by AlexWaygood · Pull Request #104294 · python/cpython · GitHub
Skip to content
Merged
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
Multiple inheritance with typing.ByteString also emits a warning
  • Loading branch information
AlexWaygood committed May 8, 2023
commit 67973d171e188b33cd7b06cedea740b348c098f1
6 changes: 3 additions & 3 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -6011,9 +6011,9 @@ def test_bytestring(self):
with self.assertWarns(DeprecationWarning):
self.assertIsInstance(bytearray(b''), ByteString)
with self.assertWarns(DeprecationWarning):
class Foo(ByteString):
def __len__(self): return 42
def __getitem__(self, n): return 42
class Foo(ByteString): ...
with self.assertWarns(DeprecationWarning):
class Bar(ByteString, typing.Awaitable): ...

def test_list(self):
self.assertIsSubclass(list, typing.List)
Expand Down