New submission from Dane Howard <dane.how...@rockwellcollins.com>:

confirmed on the following versions:
3.6.3 (Windows 10)
3.7.0 (Debian 9 & Windows 10)
3.7.1 (Debian 9)
a dictionary created with the dict() function will not always return the 
appropriate dictionary object. The following code produces the bug on all 
stated versions except 3.6.3/Win10, which exhibits slightly different behavior.

a = ['1','2','3']
b = [1,2,3]
c = zip(a,b)
print(dict(list(c))) #gives empty dict
print(dict(list(zip(a,b)))) #gives {'1':1,'2':2,'3':3}
d = zip(b,a)
print(dict(list(d))) #gives {1:'1',':'2',3:'3'}

----------
components: Windows
files: pybug.png
messages: 344729
nosy: Dane Howard, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: dict creation with converted zip objects produces inconsistent behavior
versions: Python 3.6, Python 3.7
Added file: https://bugs.python.org/file48394/pybug.png

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue37164>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to