4 ms·
I think a function is "better", but the print statement should have been preserved. Print is used either for: 1) Writing to stdout/stderr 2) Debugging the hac
by bufordsharkley 11y ago
I think a function is "better", but the print statement should have been preserved.
Print is used either for:
1) Writing to stdout/stderr
2) Debugging the hacky way
The print function is better for the former (though more often than not, I use Armin Ronacher's click.echo for compability)[0], but I fastly prefer the print statement for (2). Not dealing with parentheses is always a plus; I can add and remove print statements far more quickly.
I find it to be an increase in friction, and I don't see any real downside in leaving it in.
[0] http://click.pocoo.org/5/api/#click.echo http://click.pocoo.org/5/api/#click.echo
- untothebreach 11y agoI agree with you on 1), I much prefer `print(..., file=sys.stderr)` to `print >>sys.stderr, ...`. For 2), though, I have always used auto-inserting parens in my vim, so I never really experienced any pain w.r.t. parentheses. I can see how that would be a pain, though.
- Retra 11y agoI prefer the print function for debuging, because I can just do s/print/log.debug if I want to demote debug printing to the logger.