Whole file
viralogic/py-enumerable
The author described this change as “Issue #14 - fixed bug in except_”. It counts as a record because the check below fails on the code as it stood at 872fe09dc and passes on 0cf796bfd, with nothing else changed between the two runs.
Projectviralogic/py-enumerable
Fix saved2018-12-05
Sharing licenceMIT · LICENSE
Change size+4 −4
What the code was meant to do, written into the code itself as a save note
Issue #14 - fixed bug in except_
The change
| 493 | 493 | if not isinstance(enumerable, Enumerable): | |
| 494 | 494 | raise TypeError( | |
| 495 | 495 | u"enumerable parameter must be an instance of Enumerable") | |
| 496 | - | membership = ( | |
| 497 | - | 0 if key(element) in enumerable.intersect(self).select(key) else 1 | |
| 496 | + | membership = [ | |
| 497 | + | 0 if key(element) in enumerable.intersect(self, key).select(key) else 1 | |
| 498 | 498 | for element in self | |
| 499 | - | ) | |
| 499 | + | ] | |
| 500 | 500 | return Enumerable(itertools.compress(self, membership)) | |
| 501 | 501 | ||
| 502 | 502 | def contains(self, element, key=lambda x: x): | |
| ⋯ | |||
| 996 | 996 | raise TypeError( | |
| 997 | 997 | u"enumerable parameter must be an instance of Enumerable") | |
| 998 | 998 | membership = ( | |
| 999 | - | 0 if key(element) in enumerable.intersect(self).select(key) else 1 | |
| 999 | + | 0 if key(element) in enumerable.intersect(self, key).select(key) else 1 | |
| 1000 | 1000 | for element in self | |
| 1001 | 1001 | ) | |
| 1002 | 1002 | return Enumerable3( | |
The check that tells the two apart
fail→pass·tests/test_functions.py::TestFunctions::test_marks_except
Check file tests/test_functions.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.
Origin and history
The code before it872fe09dcdb6edf957e8ab806a0ceab140eba24b
Broken version dated2018-11-16
Modulepy_linq.py_linq
Units changedEnumerable, Enumerable3
Fingerprint325549a98bcb9d14
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.