def is_empty_object(n, last):
 if n.strip():
  return False
 last = last.strip()
 markers = {')', ';'}
 if ((not last) or (last[(-1)] in markers)):
  return False
 return True

def is_empty_object ( n , last ) : if n . strip ( ) : return False last = last . strip ( ) markers = { ')' , ';' } if ( ( not last ) or ( last [ ( - 1 ) ] in markers ) ) : return False return True
n may be the inside of block or object .