def child(self, *segments):
        """Make a new :class:`URL` where the given path segments are a child
        of this URL, preserving other parts of the URL, including the
        query string and fragment.

        For example::

            >>> url = URL.from_text(u'http://localhost/a/b?x=y')
            >>> child_url = url.child(u"c", u"d")
            >>> child_url.to_text()
            u'http://localhost/a/b/c/d?x=y'

        Args:
           segments (unicode): Additional parts to be joined and added to
              the path, like :func:`os.path.join`. Special characters
              in segments will be percent encoded.

        Returns:
           URL: A copy of the current URL with the extra path segments.

        """
        if not segments:
            return self

        segments = [_textcheck('path segment', s) for s in segments]
        new_segs = _encode_path_parts(segments, joined=False, maximal=False)
        new_path = self.path[:-1 if (self.path and self.path[-1] == u'')
                             else None] + new_segs
        return self.replace(path=new_path)
Make a new :class:`URL` where the given path segments are a child
        of this URL, preserving other parts of the URL, including the
        query string and fragment.

        For example::

            >>> url = URL.from_text(u'http://localhost/a/b?x=y')
            >>> child_url = url.child(u"c", u"d")
            >>> child_url.to_text()
            u'http://localhost/a/b/c/d?x=y'

        Args:
           segments (unicode): Additional parts to be joined and added to
              the path, like :func:`os.path.join`. Special characters
              in segments will be percent encoded.

        Returns:
           URL: A copy of the current URL with the extra path segments.

        
stackoverflow/venv/lib/python3.6/site-packages/hyperlink/_url.py