[Python-ideas] Re: A standard library Multiset implementation?

2022-08-13 Thread Matthias Görgens
Hi Brian, It sounds like a high quality third-party library that has both a multiset implementation and the itertools you needed would fulfill most of your requirements? Code in the standard library isn't magically of higher quality. Compare eg standard library dataclasses with dataclassy. As a

[Python-ideas] PEP Idea: native f-string support as a match pattern

2022-08-13 Thread Tushar Sadhwani
Since Python has built-in syntax for interpolated strings, I believe it's a good area to idea to extend it to pattern matching, like so: def unquote(string: str) -> str: match string: case f'"{value}"': return value case f"'{value}'":

[Python-ideas] PEP Idea: native f-string support as a match pattern

2022-08-13 Thread Stephen J. Turnbull
Tushar Sadhwani writes: > Since Python has built-in syntax for interpolated strings, I > believe it's a good area to idea to extend it to pattern matching, > like so: > > def unquote(string: str) -> str: > match string: > case f'"{value}"': > return

[Python-ideas] Re: PEP Idea: native f-string support as a match pattern

2022-08-13 Thread Tushar Sadhwani
Stephen J. Turnbull wrote: > I think this is a pretty unconvincing example. While people seem to > love to hate on regular expressions, it's hard to see how that beats > def unquote(string: str) -> str: > m = re.match(r"^(?:"(.*)"|'(.*)'|(?Pvalue3))$", string) RegEx feels overkill for thi

[Python-ideas] [Python-ideas][RESEND] PEP Idea: native f-string support as a match pattern

2022-08-13 Thread Stephen J. Turnbull
Sorry, I accidentally sent before I was done. Tushar Sadhwani writes: > Since Python has built-in syntax for interpolated strings, I > believe it's a good area to idea to extend it to pattern matching, > like so: > > def unquote(string: str) -> str: > match string: >