[issue37164] dict creation with converted zip objects produces inconsistent behavior

2019-06-05 Thread Dane Howard


Dane Howard  added the comment:

Yes, that seems to be it - in every case I was checking the value of c with 
`list(c)` and assuming that wouldn't change anything.

thanks!

--
stage:  -> resolved
status: open -> closed

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



[issue37164] dict creation with converted zip objects produces inconsistent behavior

2019-06-05 Thread Dane Howard


New submission from Dane Howard :

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 
<https://bugs.python.org/issue37164>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com