[Tarantool-patches] [PATCH v1 1/4] test: fix app-tap/http_client.test.lua

Alexander Turenko alexander.turenko at tarantool.org
Thu Jan 14 15:23:07 MSK 2021


> @@ -76,7 +76,7 @@ def post_handle(env, response):
>      code = "200 OK"
>      body = [env["wsgi.input"].read()]
>      headers = []
> -    for key,value in env.iteritems():
> +    for key,value in iter(env.items()):

AFAIR, <dict>.items() forms a list on Python 2, but creates an iterator
object on Python 3. Both are suitable for the for loop expression and
there is no much difference when the dictionary in not large.

iter() does not change anything here (however it is harmless).

.iteritems() was preferred by developers in Python 2 days, because it
creates an iterator, but most of times we know that a dictionary is not
large and we're okay with negligible perf. down on Python 2.


More information about the Tarantool-patches mailing list