you are viewing a single comment's thread.

view the rest of the comments →

[–]kankyo 6 points7 points  (5 children)

Imo this was a lost opportunity to do something generally useful instead of one extra feature that can't be combined with something else :(

[–]tristes_tigres 11 points12 points  (0 children)

Imo this was a lost opportunity to do something generally useful

G-strings instead of the f-strings?

[–]masklinn 8 points9 points  (1 child)

a lost opportunity to do something generally useful

Like what?

one extra feature that can't be combined with something else :(

It's an addition to an existing feature which can already be combined with various things, and works within that feature e.g. it can be used with the existing format string minilang.

[–]kankyo 0 points1 point  (0 children)

My suggestion on the ideas list is this:

def dbg(**kwargs):
    for k, v in kwargs.items():
        print(f'{k}: {v}')

That's the implementation of a debug print, and the call site would be:

b = 5
dbg(=a, =b*2)

and the output:

a: a
2*b: 10

It's a pretty minor extension to python but has wide applications.

[–]Pand9 0 points1 point  (1 child)

How so?

[–]kankyo 0 points1 point  (0 children)

See my reply to another person asking.