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.

Title: [doc] add more examples and additional explanation to re.sub
Type: enhancement Stage:
Components: Documentation Versions: Python 3.9
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, harvastum
Priority: normal Keywords:

Created on 2020-12-08 13:48 by harvastum, last changed 2022-04-11 14:59 by admin.

Messages (1)
msg382736 - (view) Author: Harvastum (harvastum) Date: 2020-12-08 13:48
This entire page:
does not have a single occurrence of the word "lambda".
In my humble opinion it's a pretty important trick to utilize capture groups in lambdas to e.g. use them to access value in a dictionary.
Examples are available here:
and here:
but somehow not in the documentation.
There is a mention about referencing groups from different contexts, but the lambda is quite unique and although I think it does fall under "when processing match object m", I think it still is worth its own entry.

Btw. it's my first contribution here, sorry for any faux pas I may have commited, please point it out if I did!
Date User Action Args
2022-04-11 14:59:39adminsetgithub: 86767
2020-12-08 13:48:29harvastumcreate