code: def test_byref_pointer(self):
      # The from_param class method of POINTER(typ) classes accepts what is
      # returned by byref(obj), it type(obj) == typ
      from ctypes import (
          c_short,
          c_uint,
          c_int,
          c_long,
          pointer,
          POINTER,
          byref,
      )
  
      LPINT = POINTER(c_int)
  
      LPINT.from_param(byref(c_int(42)))
  
      self.assertRaises(TypeError, LPINT.from_param, byref(c_short(22)))
      if c_int != c_long:
          self.assertRaises(
              TypeError, LPINT.from_param, byref(c_long(22))
          )
      self.assertRaises(TypeError, LPINT.from_param, byref(c_uint(22)))
  
file_path: catboost/contrib/tools/python/src/Lib/ctypes/test/test_parameters.py
imports: import unittest, sys
  from ctypes.test import need_symbol
  import test.support
label_desc: Use image node_id 8 for calling the SimpleTypesTestCase obj's underlying member method code with example usage: obj.test_byref_pointer() without return types