Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 16CFC200C0D for ; Tue, 31 Jan 2017 18:00:00 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 15725160B52; Tue, 31 Jan 2017 17:00:00 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 5FD36160B36 for ; Tue, 31 Jan 2017 17:59:59 +0100 (CET) Received: (qmail 51283 invoked by uid 500); 31 Jan 2017 16:59:58 -0000 Mailing-List: contact dev-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@impala.incubator.apache.org Delivered-To: mailing list dev@impala.incubator.apache.org Received: (qmail 51271 invoked by uid 99); 31 Jan 2017 16:59:58 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jan 2017 16:59:58 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id CFC391A04D6 for ; Tue, 31 Jan 2017 16:59:57 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.479 X-Spam-Level: X-Spam-Status: No, score=0.479 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=cloudera-com.20150623.gappssmtp.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id mllsmAOtSw_1 for ; Tue, 31 Jan 2017 16:59:56 +0000 (UTC) Received: from mail-it0-f41.google.com (mail-it0-f41.google.com [209.85.214.41]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 60E2C5F4EE for ; Tue, 31 Jan 2017 16:59:56 +0000 (UTC) Received: by mail-it0-f41.google.com with SMTP id 203so221128150ith.0 for ; Tue, 31 Jan 2017 08:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudera-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=8LV4VFhdXQgBmRDW+AdE2vZvq0aiJvmomlQ2pQatNRA=; b=0kZJScWwYyCmuzLsGmnbh7esym1MNR3X0EyeevUmKPo/noYIbyf0l93qLlylr0iiR5 EKTnWTpJ/98C9CNbbO5NRQO5HZ6ycbInxW92EGM0iEEaqdlmxWS9YsS4ctvoepAaaQz9 PIyjcDPewMQmjCRbgc7tjH6CpFWcdJM05Ccrp+Uy4jpHHjkkXIgGTLzMzs9ysU8YfLNt IoCDK+mlh/Uvb+4pKyU9/LppubpVh7z1DdWuv+Q4FaK7dcmHSltGfbGnNqR6T7zTcvdo pB+yupQc3ZqbmyyaqLelUaLvRX7B3+jW30Jb5ZU/5ORke+rW+0BKeC7Gt9cbWjgovvQY iPeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=8LV4VFhdXQgBmRDW+AdE2vZvq0aiJvmomlQ2pQatNRA=; b=dJXlis+kzJgWTmZ2VAg7leNrpLeJNTUkzaVQOd9uEki0/Qo240Xxpo89q989GQFhRi va5gcF/jv89Oxi5YIcQut20zTGMauw8aOkvNZfhBFbjK8y88f6cxavcSCgyM4NyC3vtj 3FySdPeQ09H2VE1tKtXfIIKi7IUMPKOfZuVN80PjXWX2inKDz0Xwx+OFZA1t926RBKb8 WsaDyRMOFsPIpgHvfy+P8hnyDo0En2aBgYbFhod1AxelEUf5xdVx4XtOFpoxyBQLrIkj yexcuGli6agQkwFdP8dK3y4S+OMpe851hlIAI8ZN+KzdFPOuYGczVtt8v9dvgKZIw+vp /CHQ== X-Gm-Message-State: AIkVDXKqwZ6g7iWaA57ySqsUlRVSkGuxQ9h1Hjfwjpu9r/iEAPpdkYhCb6ek/Ta565FFx6TR/hOffy0JTycpCPCZ X-Received: by 10.36.137.68 with SMTP id s65mr18907252itd.70.1485881991229; Tue, 31 Jan 2017 08:59:51 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.183.79 with HTTP; Tue, 31 Jan 2017 08:59:10 -0800 (PST) In-Reply-To: References: From: Michael Brown Date: Tue, 31 Jan 2017 08:59:10 -0800 Message-ID: Subject: Re: Python string formatting To: dev@impala.incubator.apache.org Content-Type: text/plain; charset=UTF-8 archived-at: Tue, 31 Jan 2017 17:00:00 -0000 Thanks. I made some comments on the review, but I see now I should probably share my general view here. My general view is, if we are going to codify our Python style guide, I would rather we codify style conventions that are closer to standard Python style conventions, rather than codify what is currently done. I am willing to keep 2-space indents and 90-char lines, but I don't think anything else should be part of the conventions when those conventions involves ignoring PEP-008. My instinct tells me the Python conventions weren't conventions at all, but came up organically without regard to actually reading conventions or using tooling. Otherwise, we'd have already had a Python style guide, right? If the concern is "But there are too many noisy errors if I am editing an existing, large file, so we should ignore these anyway", something like this is possible: git diff | flake8 --diff This will only show PEP-008 problems on changed code, not whole files. On Mon, Jan 30, 2017 at 3:20 PM, Lars Volker wrote: > Cool, thanks Michael for the reply. I added a section on Python to the 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 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 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 >> > >> doesn't >> > mention Python at all. >> > >> > Thanks, Lars >>