The latter is invariant (because List is a mutable type), so it doesn't allow
passing in lists of ModelObject subtypes.
Details
Details
- Reviewers
ardumont - Group Reviewers
Reviewers - Commits
- rDJNLeb4f3626e8f3: write_additions: Accept Iterable[ModelObject] instead of List[ModelObject]
mypy is happy
Diff Detail
Diff Detail
- Repository
- rDJNL Journal infrastructure
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 11749 Build 17811: Phabricator diff pipeline on jenkins Jenkins console · Jenkins Build 17810: arc lint + arc unit
Event Timeline
Comment Actions
Build is green
Patch application report for D2990 (id=10629)
Rebasing onto 893d285adf...
Current branch diff-target is up to date.
Changes applied before test
commit 08348047d28bfd699a827f6a6b0fcf5dc8625aca Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Apr 8 16:50:57 2020 +0200 Accept Sequence[ModelObject] instead of List[ModelObject] The latter is invariant (because List is a mutable type), so it doesn't allow passing in lists of ModelObject subtypes.
See https://jenkins.softwareheritage.org/job/DJNL/job/tests-on-diff/21/ for more details.
Comment Actions
What does it have to do with mutability?
(And it doesn't have to be a sequence, Iterable is enough)
Comment Actions
Build is green
Patch application report for D2990 (id=10635)
Rebasing onto 893d285adf...
Current branch diff-target is up to date.
Changes applied before test
commit eb4f3626e8f3f6e0cffbc610fdd47e06ddbdac22 Author: Nicolas Dandrimont <nicolas@dandrimont.eu> Date: Wed Apr 8 16:50:57 2020 +0200 write_additions: Accept Iterable[ModelObject] instead of List[ModelObject] This allows us to pass objects typed as lists of ModelObject subtypes.
See https://jenkins.softwareheritage.org/job/DJNL/job/tests-on-diff/26/ for more details.