Will Python have partial string pattern matching in 3.14?
4
68
Ṁ75Ṁ110
2025
37%
chance
1D
1W
1M
ALL
Something that solves this problem easily:
https://discuss.python.org/t/partial-string-matches-in-structural-pattern-matching/29960
I’d love to be able to use partial string matches:
match text: case "prefix_" + cmd: # checking prefix print("got", cmd) case "Hello " + last_name + ", " + first_name + "!": # more complex example print(last_name, first_name)
I know the various tricks using
split()
or guards (case s if s.startswith("prefix_")
), but this would be so much more intuitive for simple checks.
Get Ṁ200 play money
Related questions
C++26 has pattern matching?
29% chance
When will Python 3.15 be released?
2026
[Metaculus] Will Python still be most popular programming language at the end of 2030?
74% chance
Will Python add `{:}`, `{,}` and maybe `(,)` in or before 3.15 (October 2026)?
25% chance
Will someone find a truth-telling vector which modifies completions in a range of situations by 2024-10-24?
58% chance
Will Python's new No-GIL become officially supported before 2026?
76% chance
(Subjective) Will there be a reasonable means for python3 dependency resolution by 2025?
25% chance
Will Python be replaced as the go-to programming language for AI development by the end of 2040?
83% chance
Will Python make a πthon joke for release version 3.14?
88% chance