def test_counter_instantiation(self):
     self.assertIs(type(typing_extensions.Counter()), collections.Counter)
     self.assertIs(type(typing_extensions.Counter[T]()), collections.Counter)
     self.assertIs(type(typing_extensions.Counter[int]()), collections.Counter)
     class C(typing_extensions.Counter[T]): ...
     if TYPING_V3:
         self.assertIs(type(C[int]()), C)
Пример #2
0
 def test_counter_instantiation(self):
     self.assertIs(type(typing_extensions.Counter()), collections.Counter)
     self.assertIs(type(typing_extensions.Counter[T]()), collections.Counter)
     self.assertIs(type(typing_extensions.Counter[int]()), collections.Counter)
     class C(typing_extensions.Counter[T]): ...
     if TYPING_3_5_3:
         self.assertIs(type(C[int]()), C)
         self.assertEqual(C.__bases__, (typing_extensions.Counter,))