summaryrefslogtreecommitdiff
path: root/Lib/test/test_types.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_types.py')
-rw-r--r--Lib/test/test_types.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/test_types.py b/Lib/test/test_types.py
index 382ca03e5a..4a9fcba526 100644
--- a/Lib/test/test_types.py
+++ b/Lib/test/test_types.py
@@ -576,6 +576,24 @@ class TypesTests(unittest.TestCase):
self.assertGreater(object.__basicsize__, 0)
self.assertGreater(tuple.__itemsize__, 0)
+ def test_slot_wrapper_types(self):
+ self.assertIsInstance(object.__init__, types.SlotWrapperType)
+ self.assertIsInstance(object.__str__, types.SlotWrapperType)
+ self.assertIsInstance(object.__lt__, types.SlotWrapperType)
+ self.assertIsInstance(int.__lt__, types.SlotWrapperType)
+
+ def test_method_wrapper_types(self):
+ self.assertIsInstance(object().__init__, types.MethodWrapperType)
+ self.assertIsInstance(object().__str__, types.MethodWrapperType)
+ self.assertIsInstance(object().__lt__, types.MethodWrapperType)
+ self.assertIsInstance((42).__lt__, types.MethodWrapperType)
+
+ def test_method_descriptor_types(self):
+ self.assertIsInstance(str.join, types.MethodDescriptorType)
+ self.assertIsInstance(list.append, types.MethodDescriptorType)
+ self.assertIsInstance(''.join, types.BuiltinMethodType)
+ self.assertIsInstance([].append, types.BuiltinMethodType)
+
class MappingProxyTests(unittest.TestCase):
mappingproxy = types.MappingProxyType