On Wed, Oct 21, 2020 at 10:22 AM Steven D'Aprano <[email protected]> wrote: > > Well... yes. And oddly enough, developing a scanning mini-language > > inspired by the formatting language is *exactly* what this proposal > > is, and has always been. > > That's incorrect. > > The first post in this thread: > > https://mail.python.org/archives/list/[email protected]/thread/JEGSKODAK5MCO2HHUF4555JZPZ6SKNEC/ > > literally describes it as f-strings as the target. There's no hint that > only a subset of f-string functionality will be accepted. Dennis says: > > "you can assign a string to an f-string" > > and proposes an exception: > > "ValueError: f-string assignment target does not match ..."
The first post was just talking about the syntactic concept, without any explanation of how an f-string match pattern would work. Once we got to actual concrete proposals, they were always about a scanning mini-language inspired by the formatting language. I'm really not sure what you're arguing here. > I think we have at least six mini-languages now? > > - regexes > - string interpolation with % > - template strings > - format mini-language > - f-strings > - date/time format strings > > I think it would be quite an uphill battle to have a seventh built into > the language. You're welcome to write a PEP :-) > If you're going to count date/time format strings, you should also count logging formats, and a ton of other things around the place. Mini-languages aren't a problem. They're just a compact form of structured data (or code, depending on your context). What's the issue here? Remember, this is *closely related to* an existing one, meaning that it won't have the cognitive load of a complete new system. ChrisA _______________________________________________ Python-ideas mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/ZZXV6K7SHVUHKVYA4FVFRLFJW6O6S47H/ Code of Conduct: http://python.org/psf/codeofconduct/
