This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Unusued variable in test_keys in Lib/test/test_dict.py
Type: enhancement Stage: resolved
Components: Tests Versions: Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: ezio.melotti, python-dev, vajrasky
Priority: normal Keywords: patch

Created on 2013-10-04 15:53 by vajrasky, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_test_dict_unused_variable.patch vajrasky, 2013-10-04 15:53 review
Messages (3)
msg198957 - (view) Author: Vajrasky Kok (vajrasky) * Date: 2013-10-04 15:53
This is the test.

   def test_keys(self):
        d = {}
        self.assertEqual(set(d.keys()), set())
        d = {'a': 1, 'b': 2}
        k = d.keys()
        self.assertIn('a', d)
        self.assertIn('b', d)
        self.assertRaises(TypeError, d.keys, None)
        self.assertEqual(repr(dict(a=1).keys()), "dict_keys(['a'])")

As you can see, the variable k is never used. Attached the patch to give purpose to variable k.
msg198972 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-05 00:14
New changeset 92c2e76ca595 by Ezio Melotti in branch '2.7':
#19166: use an unused var in a test.  Patch by Vajrasky Kok.
http://hg.python.org/cpython/rev/92c2e76ca595

New changeset 33bbc60705e8 by Ezio Melotti in branch '3.3':
#19166: use an unused var in a test.  Patch by Vajrasky Kok.
http://hg.python.org/cpython/rev/33bbc60705e8

New changeset 16a88d026571 by Ezio Melotti in branch 'default':
#19166: merge with 3.3.
http://hg.python.org/cpython/rev/16a88d026571
msg198973 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-10-05 00:19
Fixed, thanks for the report and the patch!
History
Date User Action Args
2022-04-11 14:57:51adminsetgithub: 63365
2013-10-05 00:19:52ezio.melottisetstatus: open -> closed

type: enhancement
assignee: ezio.melotti
versions: + Python 2.7, Python 3.3
nosy: + ezio.melotti

messages: + msg198973
resolution: fixed
stage: resolved
2013-10-05 00:14:35python-devsetnosy: + python-dev
messages: + msg198972
2013-10-04 15:53:20vajraskycreate