Old Man Yells At Cloud

Rick Johnson rantingrickjohnson at gmail.com
Sun Sep 17 19:54:25 EDT 2017


Steve D'Aprano wrote:
> Tim Chase wrote:
> 
> > On 2017-09-18 00:42, Steve D'Aprano wrote:
> > > On Sun, 17 Sep 2017 11:51 pm, Tim Golden wrote:
> > > Presumably you've never wanted to print to something
> > > other than std.out. The syntax in Python 2 is horrid:
> > > 
> > > print >>sys.stderr, args
> > 
> > For those cases, the old syntax was sufficiently horrid
> > that indeed I didn't use it, but rather used
> > 
> >    print "Normal output"
> >    sys.stderr.write("error output!\n")
> > 
> > Yes, adding the \n manually is a minor annoyance, but it
> > wasn't much of an issue.
> 
> So, you don't like the extra parentheses with print. But
> you don't mind the parentheses in sys.stderr.write (16
> chars, versus five for print) or having to manually
> concatenate the strings and manually add a newline at the
> end. Because apparently using print and sys.stderr.write is
> simpler than print with parens.

It seems odd, but i have a custom function i created for my
own REPL named "pLine()", and i never have a problem
remembering to type the "(" and the ")", but for `print`, i
always forget, or when i do remember, it feels so
"unnatural". This can only mean one thing: old habits die
hard. And anyone with experience in Python<3 has typed the
old print statement so many times that the syntax has become
reflexive. And try as i may, i cannot overcome this habit. I
always get frustrated and go back to the warm fuzzies of my
Python2 interpreter. O:-)

    "You wanna go where everybody spells print the same..."
    
Cheers!



More information about the Python-list mailing list