Page MenuHomeSoftware Heritage

model: make model entities frozen
ClosedPublic

Authored by douardda on Tue, Oct 29, 2:36 PM.

Details

Summary

we do not really need them to be mutable, plus we gain their instances now
being hashable, so we can add them in set() for example.

Diff Detail

Repository
rDMOD Data Model
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

douardda created this revision.Tue, Oct 29, 2:36 PM
vlorentz accepted this revision.Tue, Oct 29, 2:39 PM
vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/model/hypothesis_strategies.py
97–101

I'd like this to be two different statement (one for draw + builds, one for evolve), for readability.

This revision is now accepted and ready to land.Tue, Oct 29, 2:39 PM
douardda added inline comments.Tue, Oct 29, 2:42 PM
swh/model/hypothesis_strategies.py
97–101

ok but what about the combo in test_todict_origin_visits() below then ;-)

vlorentz added inline comments.Tue, Oct 29, 2:47 PM
swh/model/hypothesis_strategies.py
97–101

* shrug *

douardda updated this revision to Diff 7468.Tue, Oct 29, 2:48 PM

updated according comments

This revision was automatically updated to reflect the committed changes.