This is an automated email from the ASF dual-hosted git repository. jdanek pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-python.git
commit d4d92964fa586c6349edc86100567058d341dbb4 Author: Jiri Daněk <[email protected]> AuthorDate: Mon Apr 10 11:13:42 2023 +0200 QPID-8631: prefer list comprehension syntax over `map()` and `filter()` --- qpid/spec08.py | 2 +- qpid/tests/codec.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qpid/spec08.py b/qpid/spec08.py index 343312e..d28aa64 100644 --- a/qpid/spec08.py +++ b/qpid/spec08.py @@ -364,7 +364,7 @@ def load(specfile, *errata): spec_root = doc["amqp"] spec = Spec(int(spec_root["@major"]), int(spec_root["@minor"]), specfile) - for root in [spec_root] + map(lambda x: mllib.xml_parse(x)["amqp"], errata): + for root in [spec_root] + [mllib.xml_parse(x)["amqp"] for x in errata]: # constants for nd in root.query["constant"]: val = nd["@value"] diff --git a/qpid/tests/codec.py b/qpid/tests/codec.py index e0ac26d..03f6fc2 100644 --- a/qpid/tests/codec.py +++ b/qpid/tests/codec.py @@ -661,7 +661,7 @@ def oldtests(): """ for value in ("1", "0", "110", "011", "11001", "10101", "10011"): for i in range(10): - dotest("bit", map(lambda x: x == "1", value*i)) + dotest("bit", [x == "1" for x in value*i]) for value in ({}, {"asdf": "fdsa", "fdsa": 1, "three": 3}, {"one": 1}): dotest("table", value) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
