From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 7C4ED45C305 for ; Sun, 13 Dec 2020 20:58:20 +0300 (MSK) References: From: Vladislav Shpilevoy Message-ID: <5ff2c1c5-fea6-4579-82fb-5d8ce119bf82@tarantool.org> Date: Sun, 13 Dec 2020 18:58:18 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 2/4] test: make dict.items() compatible with Python 3.x List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: sergeyb@tarantool.org, tarantool-patches@dev.tarantool.org, imun@tarantool.org Cc: alexander.turenko@tarantool.org Thanks for the patch! On 11.12.2020 09:42, Sergey Bronnikov via Tarantool-patches wrote: > From: Sergey Bronnikov > > In Python 2.x calling keys makes a copy of the key that you can iterate over What is 'keys' that I can call? Did you mean 'items'? > while modifying the dict. This doesn't work in Python 3.x because keys returns > an iterator instead of a list. Python 3 raise an exception "dictionary changed > size during iteration". To workaround it one can use list to force a copy of > the keys to be made. > > Part of #5538 > ---