code: def test_p2a_objects(self):
      array = (c_char_p * 5)()
      self.assertEqual(array._objects, None)
      array[0] = "foo bar"
      self.assertEqual(array._objects, {"0": "foo bar"})
  
      p = cast(array, POINTER(c_char_p))
      # array and p share a common _objects attribute
      self.assertIs(p._objects, array._objects)
      self.assertEqual(
          array._objects, {"0": "foo bar", id(array): array}
      )
      p[0] = "spam spam"
      self.assertEqual(p._objects, {"0": "spam spam", id(array): array})
      self.assertIs(array._objects, p._objects)
      p[1] = "foo bar"
      self.assertEqual(
          p._objects,
          {"1": "foo bar", "0": "spam spam", id(array): array},
      )
      self.assertIs(array._objects, p._objects)
  
file_path: catboost/contrib/tools/python/src/Lib/ctypes/test/test_cast.py
imports: from ctypes import *
  from ctypes.test import need_symbol
  import unittest
  import sys
label_desc: Use image node_id 3 for calling the Test obj's underlying member method code with example usage: obj.test_p2a_objects() without return types