3 ms·
Its very lame that the new format kept the bad design from C hacks. Why not 'field: {:center :minsize=8 varname}'.format(varname=123) ?
by gcb0 12y ago
Its very lame that the new format kept the bad design from C hacks.
Why not 'field: {:center :minsize=8 varname}'.format(varname=123) ?
- roywiggins 12y agoOnce you start formatting more than one variable, isn't your proposed syntax going to be horribly long? '{:center :minsize=8 varname} {:center :minsize=8 varname2} {:center :minsize=8 varname2}'.format(varname=123, varname2=123,varname3=123) instead of '{:^8} {:^8} {:^8}'.format(varname, varname2, varname3) Concision is not always a good thing, but still...
- gcb0 12y agotop one is still much more readable. also, if you are going to repeat always the same, you can standardize it in a string var and just use that instead of repeating. and if you are NOT, then it beats '{:^8} {:*8} {:@8} {:☃8}' anytime, because now you have to know and notice the change in those cryptic chars.