[Python-Dev] PEP460 thoughts from a Mercurial dev (original) (raw)

Serhiy Storchaka storchaka at gmail.com
Mon Jan 13 22:00:53 CET 2014


13.01.14 15:57, Augie Fackler написав(ла):

1) What do we need in terms of functionality

Best guess, %s, %d, and %f. I've not done a full audit of the code, but some limited looking over the grep hits for % in .py files suggests I'm right, and we could even do without %f (we only use that for 'hg --time' output, which we could do in unicode).

Most popular formatting codes in Mercurial sources (excluding %Y, %M, etc):

2519 %s
 493 %d
 102 %r
  33 %i
  23 %ld
  19 %ln
  12 %.3f
  10 %.1f
   9 %(val)r
   9 %p
   9 %.2f

%s covers almost 80% of use cases and %d covers almost 20%. %r covers about 3%, %f covers less than 1%. So I think anything except %s and %d can be ignored.



More information about the Python-Dev mailing list