qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: "Alex Bennée" <alex.bennee@linaro.org>,
	"Robert Foley" <robert.foley@linaro.org>
Cc: Peter Puhov <peter.puhov@linaro.org>,
	John Snow <jsnow@redhat.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Cleber Rosa <crosa@redhat.com>
Subject: Re: [PATCH 1/2] python/qemu: Cleanup changes to ConsoleSocket
Date: Thu, 16 Jul 2020 15:42:56 +0200	[thread overview]
Message-ID: <871c1f92-1bdd-686b-0255-44c9221f5ef7@redhat.com> (raw)
In-Reply-To: <878sfjwqkp.fsf@linaro.org>

On 7/16/20 3:13 PM, Alex Bennée wrote:
> 
> Robert Foley <robert.foley@linaro.org> writes:
> 
>> On Thu, 16 Jul 2020 at 07:07, Alex Bennée <alex.bennee@linaro.org> wrote:
>>>
>>>
>>> Robert Foley <robert.foley@linaro.org> writes:
>>>
>>>> The changes to console_socket.py and machine.py are to
>>>> cleanup for pylint and flake8.
>>>>
>>>> Signed-off-by: Robert Foley <robert.foley@linaro.org>
>>>> ---
>>>>  python/qemu/console_socket.py | 58 +++++++++++++++++------------------
>>>>  python/qemu/machine.py        |  7 +++--
>>>>  python/qemu/pylintrc          |  2 +-
>>>>  3 files changed, 34 insertions(+), 33 deletions(-)
>>>>
>>>> diff --git a/python/qemu/console_socket.py b/python/qemu/console_socket.py
>>>> index 830cb7c628..6a746c1dbf 100644
>>>> --- a/python/qemu/console_socket.py
>>>> +++ b/python/qemu/console_socket.py
>>>> @@ -1,12 +1,9 @@
>>> <snip>
>>>> @@ -103,7 +104,6 @@ class ConsoleSocket(asyncore.dispatcher):
>>>>
>>>>      def set_blocking(self):
>>>>          """Maintain compatibility with socket API"""
>>>> -        pass
>>>
>>> Hmm shouldn't this be with the change in 2/2 because I thought you
>>> needed a "pass" for an empty function in python?
>>
>> Thanks for the review !
>>
>> Sure, I can move this change to 2/2.  Probably makes more sense there
>> since we're changing this function there too.
>>
>> This change was one of the suggestions from John Snow.
>> He pointed out that the pass is not needed here since the docstring takes
>> the role of the function body.
> 
> Ahh I did not know you could do that... I'll defer to John's superior
> python knowledge.

Yes, a function with a comment is not function with an empty body...

¯\_(ツ)_/¯

When you have doubt about Python, I recommend you Gary Bernhardt's talk
from CodeMash 2012.

> 
>>
>> Thanks & Regards,
>> -Rob
>>
>>>
>>> Otherwise:
>>>
>>> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
>>>
>>> --
>>> Alex Bennée
> 
> 



  reply	other threads:[~2020-07-16 13:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15 20:48 [PATCH 0/2] python/qemu: follow-up changes for ConsoleSocket Robert Foley
2020-07-15 20:48 ` [PATCH 1/2] python/qemu: Cleanup changes to ConsoleSocket Robert Foley
2020-07-16 11:07   ` Alex Bennée
2020-07-16 12:50     ` Robert Foley
2020-07-16 13:13       ` Alex Bennée
2020-07-16 13:42         ` Philippe Mathieu-Daudé [this message]
2020-07-15 20:48 ` [PATCH 2/2] python/qemu: Change ConsoleSocket to optionally drain socket Robert Foley
2020-07-16 13:42   ` Alex Bennée
2020-07-16 17:05     ` Robert Foley

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=871c1f92-1bdd-686b-0255-44c9221f5ef7@redhat.com \
    --to=philmd@redhat.com \
    --cc=alex.bennee@linaro.org \
    --cc=crosa@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=jsnow@redhat.com \
    --cc=peter.puhov@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=robert.foley@linaro.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;
as well as URLs for NNTP newsgroup(s).