New submission from Jamie Bliss <>:

As it says in the title. ._replace() (inherited from namedtuple) doesn't  allow 
changing the generated properties.

While this is a natural consequence of how ParseResult is implemented, I would 
describe it as a deficiency of developer experience.

My work-around function for this is

components: Library (Lib)
messages: 393614
nosy: AstraLuma
priority: normal
severity: normal
status: open
title: urllib.parse.ParseResult._replace() does not allow replacing username, 
password, hostname, port
versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 

Python tracker <>
Python-bugs-list mailing list

Reply via email to