[Python-ideas] Re: Proposal: Using % sign for percentage

2019-06-26 Thread Andrew Barnert via Python-ideas
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

[Python-ideas] Re: Proposal: Using % sign for percentage

2019-06-26 Thread James Lu
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