Annotation of methods for files swh/core/negotation.py and swh/core/serializers.py
Details
- Reviewers
vlorentz - Group Reviewers
Reviewers - Maniphest Tasks
- T2256: Add type annotations to swh.core.api
- Required Signatures
L3 Software Heritage Contributor License Agreement, version 1.0
Diff Detail
- Repository
- rDCORE Foundations and core functionalities
- Branch
- type-annotation
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 10524 Build 15692: tox-on-jenkins Jenkins Build 15691: arc lint + arc unit
Event Timeline
Build is green
See https://jenkins.softwareheritage.org/job/DCORE/job/tox/400/ for more details.
Build is green
See https://jenkins.softwareheritage.org/job/DCORE/job/tox/401/ for more details.
swh/core/api/negotiation.py | ||
---|---|---|
140 | err is optional |
swh/core/api/negotiation.py | ||
---|---|---|
140 | If this err should be annoted Optional, should all other parameters with default values be Optional as well ? |
swh/core/api/negotiation.py | ||
---|---|---|
140 | No, Optional means they can be None ( https://docs.python.org/3/library/typing.html#typing.Optional ) |
swh/core/api/negotiation.py | ||
---|---|---|
140 | Yes I meant for the other parameters where None is the default parameters. For example def get_formatter(self, format: str = None, mimetype: str = None) -> Formatter: line 102. |
swh/core/api/negotiation.py | ||
---|---|---|
140 | then yes |
Build is green
See https://jenkins.softwareheritage.org/job/DCORE/job/tox/402/ for more details.
One last comment, and it should be good.
Could you also squash your commits?
swh/core/api/serializers.py | ||
---|---|---|
180 | Sorry I missed this earlier, but data should have type bytes. |