(
        self,
        url,                   # type: str
        comes_from=None,       # type: Optional[Union[str, HTMLPage]]
        requires_python=None,  # type: Optional[str]
        yanked_reason=None,    # type: Optional[Text]
    )
:param url: url of the resource pointed to (href of the link)
        :param comes_from: instance of HTMLPage where the link was found,
            or string.
        :param requires_python: String containing the `Requires-Python`
            metadata field, specified in PEP 345. This may be specified by
            a data-requires-python attribute in the HTML link tag, as
            described in PEP 503.
        :param yanked_reason: the reason the file has been yanked, if the
            file has been yanked, or None if the file hasn't been yanked.
            This is the value of the "data-yanked" attribute, if present, in
            a simple repository HTML link. If the file has been yanked but
            no reason was provided, this should be the empty string. See
            PEP 592 for more information and the specification.
:param url: url of the resource pointed to (href of the link)
        :param comes_from: instance of HTMLPage where the link was found,
            or string.
        :param requires_python: String containing the `Requires-Python`
            metadata field, specified in PEP 345. This may be specified by
            a data-requires-python attribute in the HTML link tag, as
            described in PEP 503.
        :param yanked_reason: the reason the file has been yanked, if the
            file has been yanked, or None if the file hasn't been yanked.
            This is the value of the "data-yanked" attribute, if present, in
            a simple repository HTML link. If the file has been yanked but
            no reason was provided, this should be the empty string. See
            PEP 592 for more information and the specification.
: param url : url of the resource pointed to ( href of the link ) : param comes_from : instance of HTMLPage where the link was found or string . : param requires_python : String containing the Requires - Python metadata field specified in PEP 345 . This may be specified by a data - requires - python attribute in the HTML link tag as described in PEP 503 . : param yanked_reason : the reason the file has been yanked if the file has been yanked or None if the file hasn t been yanked . This is the value of the data - yanked attribute if present in a simple repository HTML link . If the file has been yanked but no reason was provided this should be the empty string . See PEP 592 for more information and the specification .
def __init__(
        self,
        url,                   # type: str
        comes_from=None,       # type: Optional[Union[str, HTMLPage]]
        requires_python=None,  # type: Optional[str]
        yanked_reason=None,    # type: Optional[Text]
    ):
        # type: (...) -> None
        """
        :param url: url of the resource pointed to (href of the link)
        :param comes_from: instance of HTMLPage where the link was found,
            or string.
        :param requires_python: String containing the `Requires-Python`
            metadata field, specified in PEP 345. This may be specified by
            a data-requires-python attribute in the HTML link tag, as
            described in PEP 503.
        :param yanked_reason: the reason the file has been yanked, if the
            file has been yanked, or None if the file hasn't been yanked.
            This is the value of the "data-yanked" attribute, if present, in
            a simple repository HTML link. If the file has been yanked but
            no reason was provided, this should be the empty string. See
            PEP 592 for more information and the specification.
        """

        # url can be a UNC windows share
        if url.startswith('\\\\'):
            url = path_to_url(url)

        self._parsed_url = urllib_parse.urlsplit(url)
        # Store the url as a private attribute to prevent accidentally
        # trying to set a new value.
        self._url = url

        self.comes_from = comes_from
        self.requires_python = requires_python if requires_python else None
        self.yanked_reason = yanked_reason

        super(Link, self).__init__(key=url, defining_class=Link)
def __init__ ( self , url , # type: str comes_from = None , # type: Optional[Union[str, HTMLPage]] requires_python = None , # type: Optional[str] yanked_reason = None , # type: Optional[Text] ) : # type: (...) -> None # url can be a UNC windows share if url . startswith ( '\\\\' ) : url = path_to_url ( url ) self . _parsed_url = urllib_parse . urlsplit ( url ) # Store the url as a private attribute to prevent accidentally # trying to set a new value. self . _url = url self . comes_from = comes_from self . requires_python = requires_python if requires_python else None self . yanked_reason = yanked_reason super ( Link , self ) . __init__ ( key = url , defining_class = Link )