[issue40760] Dictionary comprehension using older division behavior

2020-05-24 Thread Amol Sharma


New submission from Amol Sharma :

Using comprehension to divide all the values in a dictionary like in the 
following results in integer division in 3.8.

some_dict = {k: v/5 for k, v in some_dict.items()}

This was solved by changing 5 to 5.0, reflecting behavior from python2. I would 
have expected to have the use the // operator for integer division.

Please correct me if this is expected behavior!

--
messages: 369833
nosy: Amol Sharma
priority: normal
severity: normal
status: open
title: Dictionary comprehension using older division behavior
versions: Python 3.8

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



[issue40760] Dictionary comprehension using older division behavior

2020-05-24 Thread Amol Sharma


Amol Sharma  added the comment:

My apologies! I didn't realize I was in a different environment which was 
actually 2.7.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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