Page MenuHomeSoftware Heritage

Explicitely implement from_dict instead of using introspection magic.
ClosedPublic

Authored by vlorentz on May 9 2019, 4:30 PM.

Details

Summary

There is more repetition, but it's easier to read and
'%timeit Revision.from_dict(d)' is 5 times faster.

Diff Detail

Repository
rDMOD Data model
Branch
from_dict-no-magic
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5663
Build 7733: tox-on-jenkinsJenkins
Build 7732: arc lint + arc unit

Event Timeline

douardda added a subscriber: douardda.

I agree it's easier to read, so LGTM (just a small refactoring and I'm ok with this)

swh/model/model.py
310

should be the right time to rewrite this using a list comprehension IMHO

This revision now requires changes to proceed.May 10 2019, 10:23 AM
This revision is now accepted and ready to land.May 10 2019, 10:26 AM
This revision was automatically updated to reflect the committed changes.