Get the latest tech news

PEP 750: Tag Strings for Writing Domain-Specific Languages


Hi! 👋 We are very excited to present PEP 750 - Tag Strings For Writing Domain-Specific Languages. We believe that tag strings will be a great addition to Python, which will make string processing and writing Python-based DSLs much easier. We look forward to hearing everyone’s feedback! Abstract This PEP introduces tag strings for custom, repeatable string processing. Tag strings are an extension to f-strings, with a custom function – the “tag” – in place of the f prefix. This function can...

Eric Traut: Fix 1(my recommendation): Make deferred execution explicit by having the user provide a callable in the interpolation expression. Maybe the PEP failed to give a good example, but IMO one of the strongest usecases is lazily evaluated (potentially even intentionally changed variables) templates. We didn’t want to deter the innovation that was possible by returning other objects, and especially provide hard edges that would require someone to go back to using sys._getframe for their actual problems.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of domain

domain

Photo of specific languages

specific languages

Photo of tag strings

tag strings

Related news:

News photo

Polyfill claims it has been 'defamed', returns after domain shut down

News photo

Biden Should End Verisign .Com Domain Monopoly, Groups Say

News photo

High resolution logo for any domain or stock ticker