class_docstr: Test that all type conversions are working.
class_docstr_tok: ["Test","that","all","type","conversions","are","working","."]
code: def testGenericArrayNull(self):
      def caster(s, cur):
          if s is None:
              return "nada"
          return int(s) * 2
  
      base = psycopg2.extensions.new_type((23,), "INT4", caster)
      array = psycopg2.extensions.new_array_type(
          (1007,), "INT4ARRAY", base
      )
  
      psycopg2.extensions.register_type(array, self.conn)
      a = self.execute("select '{1, 2, 3}'::int4[]")
      self.assertEqual(a, [2, 4, 6])
      a = self.execute("select '{1, 2, NULL}'::int4[]")
      self.assertEqual(a, [2, 4, "nada"])
  
imports: import string
  import ctypes
  import decimal
  import datetime
  import platform
  from .None import testutils
  import unittest
  from .testutils import ConnectingTestCase, restore_types
  from .testutils import skip_if_crdb
  import psycopg2
  from psycopg2.extensions import AsIs, adapt, register_adapter
label_desc: Use image node_id 32 for calling the TypesBasicTests obj's underlying member method code with example usage: obj.testGenericArrayNull() and returns: unknown, str