Defying all convention, this is part of the public interface of namedtuple:

  https://docs.python.org/2/library/collections.html#collections.somenamedtuple._replace

Although now that you mention it, urlparse is not documented to return a namedtuple, just "a subclass of tuple".  I'm comfortable with assuming it though.