Whole file
horejsek/python-fastjsonschema
The author described this change as “Fix false unique items”. It counts as a record because the check below fails on the code as it stood at 41ff732ae and passes on 347588fa0, with nothing else changed between the two runs.
Fix saved2022-07-17
Sharing licenceBSD-3-Clause · LICENSE
Change size+4 −0
What the code was meant to do, written into the code itself as a save note
Fix false unique items
The change
| 354 | 354 | >>> timeit.timeit("np.unique(x).size == len(x)", "x=range(100)+range(100); import numpy as np", number=100000) | |
| 355 | 355 | 2.1439831256866455 | |
| 356 | 356 | """ | |
| 357 | + | unique_definition = self._definition['uniqueItems'] | |
| 358 | + | if not unique_definition: | |
| 359 | + | return | |
| 360 | + | ||
| 357 | 361 | self.create_variable_is_list() | |
| 358 | 362 | with self.l('if {variable}_is_list:'): | |
| 359 | 363 | self.l( |
The check that tells the two apart
fail→pass·tests/test_array.py::test_not_unique_items
Check file tests/test_array.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 it41ff732ae610a3feafed84295e81fb5e84517cec
Broken version dated2022-07-17
Modulefastjsonschema.draft04
Units changedCodeGeneratorDraft04
Fingerprintc0444b8f7e4078c8
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.