News for hackers. Stuff that matters.
Re:What’s New in Python 3.8 by nostrademons on Monday October 14, 2019 @06:24PM (#21253525)
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(theta))') }
This would trivially subsume the f'{user=}' syntax for the example given: just print out the dictionary. But it'd also be useful for: filling template dictionaries; printing out status pages for HTTP webservers; returning multiple variables from a function; flattening out complex data structures; creating dispatch tables out of local functions.

You could even have a syntax like locals('theta', 'delta.days') and keep it familiar.

Re:What’s New in Python 3.8 by elcritch on Tuesday October 15, 2019 @03:34AM (#21256319)
Pretty trivial to do with proper macros in a language. Julia has macros for printing variables and values, like `@debug(var)`.

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.

1: https://github.com/meyercm/shorter_maps

Re:What’s New in Python 3.8 by airstrike on Tuesday October 15, 2019 @12:16PM (#21260146)
Can't you build your own function using format()? f-strings are just syntactic sugar for format() so presumably you can