[Python-ideas] A suggestion for Python 3 vs Python 2
Jeff Jenkins
jeff at jeffreyjenkins.ca
Wed Nov 13 16:31:14 CET 2013
On Tue, Nov 12, 2013 at 7:10 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 12 November 2013 20:47, Ethan Furman <ethan at stoneleaf.us> wrote:
> > If you don't like `print()`, do a `p = print` and then all you have is
> `p()`
> > -- of course, you just lost a bunch a readability.
> >
> > But seriously, have often does any real program use print?
>
> It's far more common in utility scripts (such as those written by
> system administrators) than it is in applications. The print change
> between Python 2 and 3 is one that doesn't really affect application
> developers all that much in practice (other than when trying things
> out in the REPL, and apparently not even then if using IPython), but
> can be more of an issue with those writing scripts where the standard
> streams are the primary IO mechanism.
>
> We tend not to hear from the latter group as much as we do from
> application developers, though.
>
>
Having written a lot of applications and both small and large scripts I've
almost universally regretted using print instead of a logger. It's
(slightly) more setup, but the second you want to make any changes to your
output (timestamps, suppressing certain messages) it more than makes up for
it.
> Cheers,
> Nick.
>
> --
> Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131113/31fb0851/attachment.html>
More information about the Python-ideas
mailing list