[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v9 01/14] iotests: do a light delinting
From: |
Kevin Wolf |
Subject: |
Re: [PATCH v9 01/14] iotests: do a light delinting |
Date: |
Mon, 30 Mar 2020 17:41:37 +0200 |
User-agent: |
Mutt/1.12.1 (2019-06-15) |
Am 25.03.2020 um 00:20 hat John Snow geschrieben:
> This doesn't fix everything in here, but it does help clean up the
> pylint report considerably.
>
> This should be 100% style changes only; the intent is to make pylint
> more useful by working on establishing a baseline for iotests that we
> can gate against in the future.
>
> Signed-off-by: John Snow <address@hidden>
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
> @@ -550,8 +546,8 @@ def flatten_qmp_object(self, obj, output=None,
> basestr=''):
> if output is None:
> output = dict()
> if isinstance(obj, list):
> - for i in range(len(obj)):
> - self.flatten_qmp_object(obj[i], output, basestr + str(i) +
> '.')
> + for i, atom in enumerate(obj):
> + self.flatten_qmp_object(atom, output, basestr + str(i) + '.')
I think atom isn't strictly the right word because we expect nested data
structures (as shown by the recursive call). If I understand correctly,
what Python calls things in lists is "items".
Kevin
- [PATCH v9 00/14] iotests: use python logging, John Snow, 2020/03/24
- [PATCH v9 01/14] iotests: do a light delinting, John Snow, 2020/03/24
- [PATCH v9 02/14] iotests: don't use 'format' for drive_add, John Snow, 2020/03/24
- [PATCH v9 03/14] iotests: ignore import warnings from pylint, John Snow, 2020/03/24
- [PATCH v9 04/14] iotests: replace mutable list default args, John Snow, 2020/03/24
- [PATCH v9 05/14] iotests: add pylintrc file, John Snow, 2020/03/24
- [PATCH v9 06/14] iotests: alphabetize standard imports, John Snow, 2020/03/24