You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I personally prefer %-style string formatting, I refrained from trying to implement it, because having both str.format and str % tuple seemed like redundancy for small Python implementation but:
There's existing code which uses %, so if we want to run it, we need to support % (I hit that when trying to run tests from CPython testsuite - rewriting them besides being monkey job leads to inability to report that we're able to run unmodifed CPython testsuite).
Why it's not in the mainline then? ;-) And yes, is you're on this topic, please go for it, but it would be nice to have basic implementation (%s/%r) soon, and then work on elaborating it.
Why it's not in the mainline then? ;-) And yes, is you're on this topic, please go for it, but it would be nice to have basic implementation (%s/%r) soon, and then work on elaborating it.
It's not on mainline yet because I haven't finished coding it :)
As soon as its all working and passing tests, then I'll be doing a pull request for the str.format stuff, which should be within a couple of days. Right now, it implements everything but the comma modifier, and I'm just hooking up the floating point stuff. I'll defer the comma operator for a later merge request.
If you want to do the very basic support for % (perhaps with just strings), I can take that and hook in the rest.
Activity
dhylands commentedon Mar 31, 2014
I can take a look at this. I've been working on str.format and have a fairly complete implementation. I'm just testing the floating point stuff now.
I wound up refactoring a bunch of the low-level pfenv functions from printf.
pfalcon commentedon Mar 31, 2014
Why it's not in the mainline then? ;-) And yes, is you're on this topic, please go for it, but it would be nice to have basic implementation (%s/%r) soon, and then work on elaborating it.
dhylands commentedon Mar 31, 2014
It's not on mainline yet because I haven't finished coding it :)
As soon as its all working and passing tests, then I'll be doing a pull request for the str.format stuff, which should be within a couple of days. Right now, it implements everything but the comma modifier, and I'm just hooking up the floating point stuff. I'll defer the comma operator for a later merge request.
If you want to do the very basic support for % (perhaps with just strings), I can take that and hook in the rest.
pfalcon commentedon Mar 31, 2014
Sounds good, pushed as 4db727a
dpgeorge commentedon Apr 5, 2014
I think this has been implemented, thanks @dhylands!
Merge pull request micropython#403 from tannewt/fix_swclk51