Whole file
ramonhagenaars/jsons
The author described this change as “Solved bug reported in Issue#64.”. It counts as a record because the check below fails on the code as it stood at 1452a681b and passes on 27b1968e0, with nothing else changed between the two runs.
Projectramonhagenaars/jsons
Fix saved2019-07-13
Sharing licenceMIT · LICENSE
Change size+3 −2
What the code was meant to do, written into the code itself as a save note
Solved bug reported in Issue#64.
The change
| 66 | 66 | return type_ | |
| 67 | 67 | ||
| 68 | 68 | @classmethod | |
| 69 | - | def with_load(cls, fork: Optional[bool] = False, **kwargs) -> type: | |
| 69 | + | def with_load(cls, fork: Optional[bool] = False, **kwargs) \ | |
| 70 | + | -> Type['JsonSerializable']: | |
| 70 | 71 | """ | |
| 71 | 72 | Return a class (``type``) that is based on JsonSerializable with the | |
| 72 | 73 | ``load`` method being automatically provided the given ``kwargs``. | |
| ⋯ | |||
| 90 | 91 | """ | |
| 91 | 92 | @classmethod | |
| 92 | 93 | def _wrapper(cls_, inst, **kwargs_): | |
| 93 | - | return load(inst, cls_, **{**kwargs_, **kwargs}) | |
| 94 | + | return load(inst, cls_, fork_inst=cls_, **{**kwargs_, **kwargs}) | |
| 94 | 95 | type_ = cls.fork() if fork else cls | |
| 95 | 96 | type_.load = _wrapper | |
| 96 | 97 | return type_ | |
The check that tells the two apart
fail→pass·tests/test_jsonserializable.py::TestJsonSerializable::test_with_load
Check file tests/test_jsonserializable.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 it1452a681b97f3cdecc5a79fd35b6ee7b58269c2e
Broken version dated2019-07-13
Modulejsons.classes.json_serializable
Units changedJsonSerializable
Fingerprintd82802ea718d8e4b
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 ramonhagenaars/jsons
- 2019-03-15default_namedtuple_deserializer