[New-bugs-announce] [issue44127] urllib.parse.ParseResult._replace() does not allow replacing username, password, hostname, port

Jamie Bliss report at bugs.python.org
Thu May 13 18:09:54 EDT 2021


New submission from Jamie Bliss <jamie at ivyleav.es>:

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

----------
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 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44127>
_______________________________________


More information about the New-bugs-announce mailing list