def dereference_type(t):
 if (t.strip() in ['void *', 'char *']):
  return t.strip()
 try:
  return t[:t.rindex('*')].strip()
 except:
  return t.strip()

def dereference_type ( t ) : if ( t . strip ( ) in [ 'void *' , 'char *' ] ) : return t . strip ( ) try : return t [ : t . rindex ( '*' ) ] . strip ( ) except : return t . strip ( )
removes everything after the last star character in a type string .