New submission from Amol Sharma <guesswh...@gmail.com>:

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 <rep...@bugs.python.org>
<https://bugs.python.org/issue40760>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to