[Python-Dev] Replacement for print in Python 3.0

Ron Adam rrr at ronadam.com
Sun Sep 4 21:52:04 CEST 2005


Raymond Hettinger wrote:
> [Barry]
> 
>>Actually, we probably only /need/ printf(), and certainly for C
>>programmers (are there any of us left? ;), I think that would be a
> 
> small
> 
>>conceptual leap.  The motivation for keeping a non-formatting version
> 
> is
> 
>>for simple cases, and beginners -- both of which use cases should not
> 
> be
> 
>>dismissed.
> 
> 
> +1 on Barry's proposal for two functions, one formatted and one plain.


+1


There is ...

 >>> '%r+%r = %r'.__mod__((1,2,3))
'1+2 = 3'

Ok, not exactly what he proposed.  ;-)

Is there a better named method that str.__mod__() calls?



> However, I take issue with the premise that beginners do not need
> formatting.  Almost anyone, beginner or not, needs formatting when they
> are working on a real application.  My experience is that finance people
> immediately try to format their output (habits from Excel).  Most are
> astonished at how non-trivial it is to add commas, dollar signs,
> brackets, and a fixed number of decimal places.  So, I think beginners
> should be considered a key constituent for output formatting and that
> their needs should be accommodated as simply and broadly as possible.

I agree, and the next thing programmers with previous experience look 
for is formatted input.  Ok, not the very next thing. :-)

Cheers,
Ron



More information about the Python-Dev mailing list