Metaforecast is shutting down. The site will be taken offline on July 9, 2026.
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.
| Indicator | Value |
|---|---|
| Stars | ★★☆☆☆ |
| Platform | Manifold Markets |
| Forecasters | 6 |
| Volume | M1.2k |
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 ...