class_docstr: Helper class to convert between `Range` and PostgreSQL range types.
  
  Objects of this class are usually created by `register_range()`. Manual
  creation could be useful if querying the database is not advisable: in
  this case the oids must be provided.
class_docstr_tok: ["Helper","class","to","convert","between","`","Range","`","and","PostgreSQL","range","types",".","Objects","of","this","class","are","usually","created","by","`","register_range","(",")","`",".","Manual","creation","could","be","useful","if","querying","the","database","is","not","advisable",":","in","this","case","the","oids","must","be","provided","."]
code: def __init__(
      self, pgrange, pyrange, oid, subtype_oid, array_oid=None
  ):
      self.subtype_oid = subtype_oid
      self._create_ranges(pgrange, pyrange)
  
      name = self.adapter.name or self.adapter.__class__.__name__
  
      self.typecaster = new_type((oid,), name, self.parse)
  
      if array_oid is not None:
          self.array_typecaster = new_array_type(
              (array_oid,), name + "ARRAY", self.typecaster
          )
      else:
          self.array_typecaster = None
  
imports: import re
  from psycopg2._psycopg import ProgrammingError, InterfaceError
  from psycopg2.extensions import ISQLQuote, adapt, register_adapter
  from psycopg2.extensions import new_type, new_array_type, register_type
label_desc: Use image node_id 1 to create a new RangeCaster object  with example: obj = RangeCaster(pgrange, pyrange, oid, subtype_oid, array_oid)