impala-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Volker ...@cloudera.com>
Subject Re: Python string formatting
Date Mon, 30 Jan 2017 23:20:24 GMT
Cool, thanks Michael for the reply. I added a section on Python to the Impala
Style Guide
<https://cwiki.apache.org/confluence/display/IMPALA/Impala+Style+Guide>.
Please feel free to edit it or let me know if I should make changes. I will
also send out a review to add a .pep8rc file to the repository.

On Fri, Jan 27, 2017 at 11:56 PM, Michael Brown <mikeb@cloudera.com> wrote:

> I prefer str.format() over the % operator, because:
>
> https://docs.python.org/2.7/library/stdtypes.html#str.format
>
> "This method of string formatting is the new standard in Python 3, and
> should be preferred to the % formatting described in String Formatting
> Operations in new code."
>
> Without an Impala Python style guide, I tend to use what I see on
> docs.python.org, modulo our 2-space indent and 90-char line policy.
>
>
> On Fri, Jan 27, 2017 at 2:44 PM, Lars Volker <lv@cloudera.com> wrote:
> > Hi All,
> >
> > do we have a strong preference for either old style or new style string
> > formatting in Python?
> >
> > "Hello %s!" % ("world") *vs* "Hello {0}!".format("world")
> >
> > The Impala Style Guide
> > <https://cwiki.apache.org/confluence/display/IMPALA/Impala+Style+Guide>
> doesn't
> > mention Python at all.
> >
> > Thanks, Lars
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message