This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urllib.parse.ParseResult._replace() does not allow replacing username, password, hostname, port
Type: Stage:
Components: Library (Lib) Versions: Python 3.11, Python 3.10, Python 3.9, Python 3.8, Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: AstraLuma
Priority: normal Keywords:

Created on 2021-05-13 22:09 by AstraLuma, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg393614 - (view) Author: Jamie Bliss (AstraLuma) Date: 2021-05-13 22:09
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 https://gist.github.com/AstraLuma/00e511feb1f619f407d07e968d69f36b
History
Date User Action Args
2022-04-11 14:59:45adminsetgithub: 88293
2021-05-13 22:09:54AstraLumacreate