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 list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at
https://mail.python.org/archives/list/[email protected]/message/DHACYJQLXNXLQCD3STGPQOQVNQ2AUZFE/
Code of Conduct: http://python.org/psf/codeofconduct/