The expansion of f-strings is a welcome addition. The more I use them, the happier I am that they exist https://docs.python.org/3/whatsnew/3.8.html#f-strings-suppor...
I saw that and was like "Oh, that'd be a handy feature for a lot of other programming languages too." But the more I think about it, the more I'd rather have a feature that takes a list of expressions and converts it into a dict where the keys are the expression text and the values are the values of those expressions. Basically, syntactic sugar for this: { k: eval(k) for k in ('theta', 'delta.days', 'cos(radians(thet…
There's an Elixir library with macros to make a map (dictionary) using the variable names passed in [1]:
iex> import ShorterMaps
...> name = "Chris"
...> id = 6
...> ~M{name, id}
%{name: "Chris", id: 6}
Though wether its a good idea or not is another question. ;) If you want to do the type of programming you're talking about you should try Elixir/Julia/Clojure(/Rust?)... or any number of other languages with macros.