Tarantool development patches archive
 help / color / mirror / Atom feed
From: sergeyb@tarantool.org
To: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org,
	lvasiliev@tarantool.org
Cc: Sergey Bronnikov <estetus@gmail.com>
Subject: [Tarantool-patches] [PATCH v3 4/5] test: get rid of iteritems()
Date: Wed, 23 Dec 2020 15:36:10 +0300	[thread overview]
Message-ID: <9f16ab29ec24d78458371a376e03f098b7d32a39.1608726409.git.estetus@gmail.com> (raw)
In-Reply-To: <cover.1608726409.git.estetus@gmail.com>

From: Sergey Bronnikov <estetus@gmail.com>

For Python 3, PEP 3106 changed the design of the dict builtin and the
mapping API in general to replace the separate list based and iterator
based APIs in Python 2 with a merged, memory efficient set and multiset
view based API. This new style of dict iteration was also added to the
Python 2.7 dict type as a new set of iteration methods. PEP-0469 [1]
recommends to replace d.iteritems() to iter(d.items()) to make code
compatible with Python 3.

1. https://www.python.org/dev/peps/pep-0469/

Part of #5538
---
 test/app-tap/httpd.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/test/app-tap/httpd.py b/test/app-tap/httpd.py
index b57ef1e39..a2dee1b83 100755
--- a/test/app-tap/httpd.py
+++ b/test/app-tap/httpd.py
@@ -66,7 +66,7 @@ def read_handle(env, response):
     body = ["Not Found"]
     if env["PATH_INFO"] in paths:
         code, body, headers = paths[env["PATH_INFO"]]()
-    for key,value in env.iteritems():
+    for key,value in iter(env.items()):
         if "HTTP_" in key:
             headers.append((key[5:].lower(), value))
     response(code, headers)
-- 
2.25.1

  parent reply	other threads:[~2020-12-23 12:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 12:36 [Tarantool-patches] [PATCH v3 0/5] Support Python 3 in tests and PEPify source code sergeyb
2020-12-23 12:36 ` [Tarantool-patches] [PATCH v3 1/5] test: convert print to function and make quotes use consistent sergeyb
2020-12-23 15:39   ` Vladislav Shpilevoy
2020-12-24 10:50     ` Sergey Bronnikov
2020-12-23 12:36 ` [Tarantool-patches] [PATCH v3 2/5] test: make dict.items() compatible with Python 3.x sergeyb
2020-12-23 12:36 ` [Tarantool-patches] [PATCH v3 3/5] test: make strings compatible with Python 3 sergeyb
2020-12-23 15:40   ` Vladislav Shpilevoy
2020-12-24 11:03     ` Sergey Bronnikov
2020-12-23 12:36 ` sergeyb [this message]
2020-12-23 12:36 ` [Tarantool-patches] [PATCH v3 5/5] test: remove dead code in Python tests end extra newlines sergeyb
2020-12-23 23:42 ` [Tarantool-patches] [PATCH v3 0/5] Support Python 3 in tests and PEPify source code Leonid Vasiliev
2020-12-24 16:05 ` Vladislav Shpilevoy

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=9f16ab29ec24d78458371a376e03f098b7d32a39.1608726409.git.estetus@gmail.com \
    --to=sergeyb@tarantool.org \
    --cc=estetus@gmail.com \
    --cc=lvasiliev@tarantool.org \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v3 4/5] test: get rid of iteritems()' \
    /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