From: Michael Goldish <mgoldish@redhat.com>
To: Marc Enthus <cxzdes@gmail.com>
Cc: autotest@test.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] KVM-test: kvm.py: Code style fix
Date: Tue, 08 Jun 2010 20:50:56 +0300 [thread overview]
Message-ID: <4C0E8300.9000001@redhat.com> (raw)
In-Reply-To: <20100608080224.GA20396@t4.rh>
On 06/08/2010 11:02 AM, Marc Enthus wrote:
> From: Marc Enthus <cxzdes@gmail.com>
>
> According to autotest coding style
> and http://www.python.org/dev/peps/pep-0008/
>
> use
> if pa_type is not None:
> instead of
> if pa_type:
>
> Signed-off-by: Marc Enthus <cxzdes@gmail.com>
> ---
> client/tests/kvm/kvm_vm.py | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
> index f3ce4d6..0080b15 100755
> --- a/client/tests/kvm/kvm_vm.py
> +++ b/client/tests/kvm/kvm_vm.py
> @@ -516,7 +516,7 @@ class VM:
> pa_type)
> return False
>
> - elif pa_type and pa_type != "no":
> + elif pa_type is not None and pa_type != "no":
> logging.warn("Unsupported pci_assignable type: %s", pa_type)
>
> # Make qemu command
>
>
The condition 'if pa_type' is meant to exclude both None and "". Both
are possible and both indicate that the user isn't interested in pa_type
at all. In that case 'if pa_type' conforms to PEP 8 AFAIK. I'm not
sure about the autotest coding style though.
next prev parent reply other threads:[~2010-06-08 17:50 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-08 8:02 [PATCH] KVM-test: kvm.py: Code style fix Marc Enthus
2010-06-08 17:50 ` Michael Goldish [this message]
2010-06-08 18:22 ` Lucas Meneghel Rodrigues
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4C0E8300.9000001@redhat.com \
--to=mgoldish@redhat.com \
--cc=autotest@test.kernel.org \
--cc=cxzdes@gmail.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox