Whole file
gaogaotiantian/objprint
The author described this change as “Fix list and dict exclude/include feature (#28)”. It counts as a record because the check below fails on the code as it stood at 1c76f2cef and passes on 8e3bd5e47, with nothing else changed between the two runs.
Projectgaogaotiantian/objprint
Fix saved2021-05-11
Sharing licenceApache-2.0 · LICENSE
Change size+2 −2
What the code was meant to do, written into the code itself as a save note
Fix list and dict exclude/include feature (#28)
The change
| 53 | 53 | return self._get_ellipsis(obj) | |
| 54 | 54 | ||
| 55 | 55 | if isinstance(obj, list) or isinstance(obj, tuple) or isinstance(obj, set): | |
| 56 | - | elems = (f"{self.objstr(val, indent_level + 1)}" for val in obj) | |
| 56 | + | elems = (f"{self.objstr(val, indent_level + 1, include=include, exclude=exclude)}" for val in obj) | |
| 57 | 57 | elif isinstance(obj, dict): | |
| 58 | 58 | elems = ( | |
| 59 | - | f"{self.objstr(key, indent_level + 1)}: {self.objstr(val, indent_level + 1)}" | |
| 59 | + | f"{self.objstr(key, indent_level + 1)}: {self.objstr(val, indent_level + 1, include=include, exclude=exclude)}" | |
| 60 | 60 | for key, val in sorted(obj.items()) | |
| 61 | 61 | ) | |
| 62 | 62 | else: |
The check that tells the two apart
fail→pass·tests/test_objstr.py::TestObjStr::test_nested_match
Check file tests/test_objstr.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 it1c76f2cef0d4652e4c8ebede2f66f66797a2bf70
Broken version dated2021-05-10
Moduleobjprint.objprint
Units changedObjPrint
Fingerprintf08e59a7aa0123b0
Checked2026-08-18 by goldset/0.1
Every field above is generated by our program. None of it is written by hand.
Other bugs found in gaogaotiantian/objprint
- 2025-04-02Fix printing built-in methods that miss signatures (#121)
- 2022-03-08Fix printing unsortable dict (#54)
- 2021-05-24Fix elements overflow issue (#31)
- 2021-03-10Fix empty multi-line object (#4)