def splittag(url):
 (path, delim, tag) = url.rpartition('#')
 if delim:
  return (path, tag)
 return (url, None)

def splittag ( url ) : ( path , delim , tag ) = url . rpartition ( '#' ) if delim : return ( path , tag ) return ( url , None )
splittag --> /path .