On Jun 25, 2019, at 08:44, James Lu wrote:
>
> What if we had reverse format strings, i.e. reading formatted input?
>
> x = readf("{:.0%}", "50%")
> # => x == 0.50
> x = readf("{:.0}", "50")
> # => x == 0.50
>
> Readf takes the repr() of its second argument and “un-formats” the string.
What’s
What if we had reverse format strings, i.e. reading formatted input?
x = readf("{:.0%}", "50%")
# => x == 0.50
x = readf("{:.0}", "50")
# => x == 0.50
Readf takes the repr() of its second argument and “un-formats” the string.
___
Python-ideas mailing