Re:Anyprint: use any language's print statements in Python
by est on Tuesday July 18, 2017 @09:06PM
(#14801358)
print chevron in python2 is super awesome
It just feels more "powerful" than Py3k's
[ Parent
| on HN ]
Re:Anyprint: use any language's print statements in Python
by masklinn on Wednesday July 19, 2017 @03:53AM
(#14802608)
> print chevron in python2 is super awesome
Print chevron is super awful, it's unreadable, hard to remember and difficult to search for.
The print function was a welcome improvement: it's not a statement (so can be used in a lambda, no need to fall back to sys.stdout.write), it doesn't use weird-ass syntax to redirect or suppress the final newline and it's more extensible (e.g. "end" or "flush" kwargs would have been… challenging to add to the keyword version)
Re:Anyprint: use any language's print statements in Python
by nhumrich on Tuesday July 18, 2017 @11:59PM
(#14801923)
> More powerful
But less obvious and readable, which is anti pythonic. If you want "power" over readability, there is ruby/perl.
Re:Anyprint: use any language's print statements in Python
by wruza on Wednesday July 19, 2017 @07:18AM
(#14803479)
I'm not going to discuss perl readability, but the fact is that I cannot simply 0%% to beginning of the block in "readable" python. ?:$<CR> does its job though.
Re:Anyprint: use any language's print statements in Python
by masklinn on Wednesday July 19, 2017 @03:56AM
(#14802616)
Note that they say it feels more powerful, it's not like it is more powerful than the file kwarg.
Re:Anyprint: use any language's print statements in Python
by RodericDay on Wednesday July 19, 2017 @06:08AM
(#14803176)
If you want power you can
fprint = lambda string: print(string, file=somefile)
and use fprint all over the placethat little chevron trick is bad imo