Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Sergey Bronnikov <sergeyb@tarantool.org>
Cc: Sergey Bronnikov <estetus@gmail.com>,
	tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v1 1/4] test: fix app-tap/http_client.test.lua
Date: Thu, 14 Jan 2021 15:57:02 +0300	[thread overview]
Message-ID: <20210114125702.b4m57d7nen5mzuv3@tkn_work_nb> (raw)
In-Reply-To: <166276bb-8c56-589f-21d2-09eead7091b0@tarantool.org>

On Thu, Jan 14, 2021 at 03:52:06PM +0300, Sergey Bronnikov wrote:
> Thanks for review!
> 
> On 14.01.2021 15:23, Alexander Turenko wrote:
> > > @@ -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.
> 
> Generally it is so. Although PEP-0469 recommends to convert d.items() to
> iter(d.iteritems()) [1].

It is the most common way: so if one pass the iterator to some function,
which expects an iterator object (but not a list), it'll work.

However for most usages (such as in a loop expressions), .items() is
enough.

  reply	other threads:[~2021-01-14 12:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  8:48 [Tarantool-patches] [PATCH v1 0/4] Support Python 3 in Tarantool tests Sergey Bronnikov via Tarantool-patches
2021-01-13  8:48 ` [Tarantool-patches] [PATCH v1 1/4] test: fix app-tap/http_client.test.lua Sergey Bronnikov via Tarantool-patches
2021-01-14  8:47   ` Leonid Vasiliev via Tarantool-patches
2021-01-14  9:50     ` Sergey Bronnikov via Tarantool-patches
2021-01-14 12:23   ` Alexander Turenko via Tarantool-patches
2021-01-14 12:52     ` Sergey Bronnikov via Tarantool-patches
2021-01-14 12:57       ` Alexander Turenko via Tarantool-patches [this message]
2021-01-13  8:48 ` [Tarantool-patches] [PATCH v1 2/4] test: fix xlog-py/big_lsn.test.py Sergey Bronnikov via Tarantool-patches
2021-01-14  9:02   ` Leonid Vasiliev via Tarantool-patches
2021-01-14  9:51     ` Sergey Bronnikov via Tarantool-patches
2021-01-14 12:38   ` Alexander Turenko via Tarantool-patches
2021-01-14 12:52     ` Sergey Bronnikov via Tarantool-patches
2021-01-13  8:48 ` [Tarantool-patches] [PATCH v1 3/4] test: enable SO_REUSEADDR on socket in httpd.py Sergey Bronnikov via Tarantool-patches
2021-01-13 19:59   ` Cyrill Gorcunov via Tarantool-patches
2021-01-14  9:09   ` Leonid Vasiliev via Tarantool-patches
2021-01-14  9:57     ` Sergey Bronnikov via Tarantool-patches
2021-01-14 12:51       ` Alexander Turenko via Tarantool-patches
2021-01-13  8:48 ` [Tarantool-patches] [PATCH v1 4/4] test: enable disabled testcases back Sergey Bronnikov via Tarantool-patches
2021-01-14  9:10   ` Leonid Vasiliev via Tarantool-patches
2021-01-13 20:03 ` [Tarantool-patches] [PATCH v1 0/4] Support Python 3 in Tarantool tests Cyrill Gorcunov via Tarantool-patches
2021-01-14 11:10 ` Leonid Vasiliev via Tarantool-patches
2021-01-15  9:34 ` Kirill Yukhin via Tarantool-patches

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=20210114125702.b4m57d7nen5mzuv3@tkn_work_nb \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=estetus@gmail.com \
    --cc=sergeyb@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v1 1/4] test: fix app-tap/http_client.test.lua' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox