[Tarantool-patches] [PATCH 2/4] test: make dict.items() compatible with Python 3.x

Vladislav Shpilevoy v.shpilevoy at tarantool.org
Sun Dec 13 20:58:18 MSK 2020


Thanks for the patch!

On 11.12.2020 09:42, Sergey Bronnikov via Tarantool-patches wrote:
> From: Sergey Bronnikov <sergeyb at tarantool.org>
> 
> 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
> ---


More information about the Tarantool-patches mailing list