(self, scheme=misc.UseExisting, userinfo=misc.UseExisting,
                  host=misc.UseExisting, port=misc.UseExisting,
                  path=misc.UseExisting, query=misc.UseExisting,
                  fragment=misc.UseExisting, lazy_normalize=True)
return ParseResultBytes(
            uri_ref=ref,
            encoding=self.encoding,
            lazy_normalize=lazy_normalize,
            **attrs_dict
        )
Create a copy of this instance replacing with specified parts.
Create a copy of this instance replacing with specified parts.
Create a copy of this instance replacing with specified parts .
def copy_with(self, scheme=misc.UseExisting, userinfo=misc.UseExisting,
                  host=misc.UseExisting, port=misc.UseExisting,
                  path=misc.UseExisting, query=misc.UseExisting,
                  fragment=misc.UseExisting, lazy_normalize=True):
        """Create a copy of this instance replacing with specified parts."""
        attributes = zip(PARSED_COMPONENTS,
                         (scheme, userinfo, host, port, path, query, fragment))
        attrs_dict = {}
        for name, value in attributes:
            if value is misc.UseExisting:
                value = getattr(self, name)
            if not isinstance(value, bytes) and hasattr(value, 'encode'):
                value = value.encode(self.encoding)
            attrs_dict[name] = value
        authority = self._generate_authority(attrs_dict)
        to_str = compat.to_str
        ref = self.reference.copy_with(
            scheme=to_str(attrs_dict['scheme'], self.encoding),
            authority=to_str(authority, self.encoding),
            path=to_str(attrs_dict['path'], self.encoding),
            query=to_str(attrs_dict['query'], self.encoding),
            fragment=to_str(attrs_dict['fragment'], self.encoding)
        )
        if not lazy_normalize:
            ref = ref.normalize()
        return ParseResultBytes(
            uri_ref=ref,
            encoding=self.encoding,
            lazy_normalize=lazy_normalize,
            **attrs_dict
        )
def copy_with ( self , scheme = misc . UseExisting , userinfo = misc . UseExisting , host = misc . UseExisting , port = misc . UseExisting , path = misc . UseExisting , query = misc . UseExisting , fragment = misc . UseExisting , lazy_normalize = True ) : attributes = zip ( PARSED_COMPONENTS , ( scheme , userinfo , host , port , path , query , fragment ) ) attrs_dict = { } for name , value in attributes : if value is misc . UseExisting : value = getattr ( self , name ) if not isinstance ( value , bytes ) and hasattr ( value , 'encode' ) : value = value . encode ( self . encoding ) attrs_dict [ name ] = value authority = self . _generate_authority ( attrs_dict ) to_str = compat . to_str ref = self . reference . copy_with ( scheme = to_str ( attrs_dict [ 'scheme' ] , self . encoding ) , authority = to_str ( authority , self . encoding ) , path = to_str ( attrs_dict [ 'path' ] , self . encoding ) , query = to_str ( attrs_dict [ 'query' ] , self . encoding ) , fragment = to_str ( attrs_dict [ 'fragment' ] , self . encoding ) ) if not lazy_normalize : ref = ref . normalize ( ) return ParseResultBytes ( uri_ref = ref , encoding = self . encoding , lazy_normalize = lazy_normalize , * * attrs_dict )