osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Old Man Yells At Cloud


print >>sys.stderr, 'learn special syntax only for print?'

print('you can use keword argument not only print', file=sys.stderr)
p = functools.partial(print, file=sys.stderr)
p('you can use other mechanizms for function')

I never want to teach >> syntax for new people.

On 2017?9?17?(?) 22:55 Abdur-Rahmaan Janhangeer <arj.python at gmail.com>
wrote:

> ah the only thing i miss in py2 very sad and it was a well heralded arg in
> favour of py
>
> print "i miss you simple print"
>
> Abdur-Rahmaan Janhangeer,
> Mauritius
> abdurrahmaanjanhangeer.wordpress.com
>
> On 17 Sep 2017 17:50, "Tim Golden" <mail at timgolden.me.uk> wrote:
>
> >
> >
> > On 17/09/2017 14:34, breamoreboy at gmail.com wrote:
> >
> >> On Sunday, September 17, 2017 at 2:16:48 PM UTC+1, bartc wrote:
> >>
> >>>
> >>> print can also be used for debugging, when it might be written, deleted
> >>> and added again hundreds of times. So writing all those brackets
> becomes
> >>> irksome. 'print' needs to be easy to write.
> >>>
> >>> --
> >>> bartc
> >>>
> >>
> >> Experienced Python programmers use the logging module for debugging,
> >> write once, delete (maybe) never.
> >>
> >
> > FWIW I'm with Bart on this one. Print-as-a-function removed one small
> > simplicity which I appreciated in Python as I first encountered it. And
> I'm
> > entirely unconvinced that the benefit is worth it. That was my view when
> > Python 3 was launched and several years of happily using Python 3 have
> not
> > made a difference to my opinion on this particular point: I simply grin
> and
> > bear it.
> >
> > Funnily enough, the two arguments most often advanced for
> > print-as-function seem to me to cancel each other out. Argument 1 is
> "this
> > way you can redefine print to be, eg, write_to_this_log"; and Argument 2
> is
> > "but no-one uses print in real code anyway" -- more or less what Mark
> > offered just now.
> >
> > Well if no-one uses it in real code, then its ability to be redefined is
> > moot. (Or, rather, the strength of that argument is diminished).
> >
> > In my own code I'm obviously quite capable of defining a function p()
> > which does whatever I want in terms of printing etc. But where this bites
> > me the most is in the interactive interpreter. Yes, I'm aware I can add
> > things to site.py etc. etc. My point would still be that I'm working
> around
> > a change which appears to be solving a problem I didn't have!
> >
> > TJG
> > --
> > https://mail.python.org/mailman/listinfo/python-list
> >
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
Inada Naoki <songofacandy at gmail.com>