parameters: (context, builder, sig, args)
docstring: Default implementation for `x is y`
docstring_summary: Default implementation for `x is y`
docstring_tokens: Default implementation for x is y
function: def generic_is(context, builder, sig, args):
      """
      Default implementation for `x is y`
      """
      lhs_type, rhs_type = sig.args
      # the lhs and rhs have the same type
      if lhs_type == rhs_type:
              # mutable types
              if lhs_type.mutable:
                  raise NotImplementedError('no default `is` implementation')
              # immutable types
              else:
                  # fallbacks to `==`
                  try:
                      eq_impl = context.get_function(operator.eq, sig)
                  except NotImplementedError:
                      # no `==` implemented for this type
                      return cgutils.false_bit
                  else:
                      return eq_impl(builder, args)
      else:
          return cgutils.false_bit
function_tokens: def generic_is ( context , builder , sig , args ) : lhs_type , rhs_type = sig . args # the lhs and rhs have the same type if lhs_type == rhs_type : # mutable types if lhs_type . mutable : raise NotImplementedError ( 'no default `is` implementation' ) # immutable types else : # fallbacks to `==` try : eq_impl = context . get_function ( operator . eq , sig ) except NotImplementedError : # no `==` implemented for this type return cgutils . false_bit else : return eq_impl ( builder , args ) else : return cgutils . false_bit