News for hackers. Stuff that matters.
Re:What’s New in Python 3.8 by bhl on Monday October 14, 2019 @11:40PM (#21255358)
Why didn’t Python ship with the opposite functionality as well? Parsing instead of formatting. Given a string and a format string, return a list of variables (or a dictionary).
Re:What’s New in Python 3.8 by rcfox on Tuesday October 15, 2019 @12:15AM (#21255511)
Re:What’s New in Python 3.8 by ash on Tuesday October 15, 2019 @09:27AM (#21258101)
Are you talking about parsing f-strings? How would that look like?

As far I understand the following:

    print(f"your name is {name}")
is roughly equivalent to:

    print(f"your name is " + format(name))
What is there to parse?
Re:What’s New in Python 3.8 by bhl on Tuesday October 15, 2019 @11:35AM (#21259560)
For example, to checkpoint a model, I would save it as “ckpt-{epoch_number}-{val_loss}”. Given this file name and the original format string, I would like to recover the epoch number and validation loss variables back.

From: ckpt-8-0.300 To: epoch=8, val_loss=0.300

Re:What’s New in Python 3.8 by bhy on Tuesday October 15, 2019 @04:48AM (#21256662)
I think this is what you want:

https://github.com/r1chardj0n3s/parse