8000 GH-103699: Add `__orig_bases__` to various typing classes by adriangb · Pull Request #103698 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

GH-103699: Add __orig_bases__ to various typing classes #103698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 23, 2023
Prev Previous commit
Next Next commit
one more test
  • Loading branch information
adriangb committed Apr 23, 2023
commit b777373b1719331aec2aab2649cb4d804a490f66
4 changes: 4 additions & 0 deletions Lib/test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7153,6 +7153,9 @@ class OtherGenericChild(GenericParent[str]):
class MixedGenericChild(GenericChild, OtherGenericChild, GenericParent[float]):
pass

class MultipleGenericBases(GenericParent[int], GenericParent[float]):
pass

self.assertEqual(Parent.__orig_bases__, (TypedDict,))
self.assertEqual(Child.__orig_bases__, (Parent,))
self.assertEqual(OtherChild.__orig_bases__, (Parent,))
Expand All @@ -7161,6 +7164,7 @@ class MixedGenericChild(GenericChild, OtherGenericChild, GenericParent[float]):
self.assertEqual(GenericChild.__orig_bases__, (GenericParent[int],))
self.assertEqual(OtherGenericChild.__orig_bases__, (GenericParent[str],))
self.assertEqual(MixedGenericChild.__orig_bases__, (GenericChild, OtherGenericChild, GenericParent[float]))
self.assertEqual(MultipleGenericBases.__orig_bases__, (GenericParent[int], GenericParent[float]))


class RequiredTests(BaseTestCase):
Expand Down
0