Another way this could go: If PEP 634 (pattern matching, reborn) gets accepted, a future Python version could add f-string patterns (which the PEP currently forbids). E.g. ``` x = "123 456 789" match x: case f"{a} {b}": print("A pair:", a, b) case f"{a} {b} {c}": print("Triple", a, b, c) ``` Everything else (e.g. how to design the formatting language) would be open. We could even designate "raw" f-strings (rf"...") as regular expressions (<wink 0.5>).
-- --Guido van Rossum (python.org/~guido) *Pronouns: he/him **(why is my pronoun here?)* <http://feministing.com/2015/02/03/how-using-they-as-a-singular-pronoun-can-change-the-world/>
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/3YAWBXMD2J25CRFMHZC4IW67SJGJWWCE/ Code of Conduct: http://python.org/psf/codeofconduct/