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: rm needless use of set function
Type: behavior Stage: resolved
Components: Distutils2 Versions: 3rd party
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: alexis, eric.araujo, tarek, tshepang
Priority: normal Keywords: patch

Created on 2012-02-06 08:28 by tshepang, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
rm-needless-use-of-set-function.patch tshepang, 2012-02-06 08:28 review
Messages (4)
msg152725 - (view) Author: Tshepang Lekhonkhobe (tshepang) * Date: 2012-02-06 08:28
I assume that the set() function was used to get rid of duplicates from self.versions, but there aren't any and the test would pass even if there were.
msg152738 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-06 15:01
Yes, this test method could be a little clearer.  I’ll do this.
msg153157 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-12 04:01
Done as part of my general test_version cleanup.
msg153618 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2012-02-18 01:14
Using a set is actually needed: list membership testing does not use hashes (but probably equality), whereas set and dict membership tests does uses hashes.

(I wrote a class with an __hash__ method that prints something when called, and “test() in []” does not print anything, whereas “test() in set()” does.  So test_hash now uses a set again, and I added a comment to clarify why.)
History
Date User Action Args
2022-04-11 14:57:26adminsetgithub: 58156
2012-02-18 01:14:43eric.araujosetresolution: duplicate -> not a bug
superseder: Get rid of doctests in packaging.tests.test_version ->
messages: + msg153618
2012-02-12 04:01:18eric.araujosetstatus: open -> closed
resolution: duplicate
messages: + msg153157

superseder: Get rid of doctests in packaging.tests.test_version
stage: resolved
2012-02-06 15:01:21eric.araujosetassignee: tarek -> eric.araujo
messages: + msg152738
versions: + 3rd party
2012-02-06 08:28:07tshepangcreate