Page MenuHomeSoftware Heritage

Add type annotations to metadata mappings
Closed, MigratedEdits Locked

Description

Files in swh/indexer/metadata_dictionary/ currently do not have any type annotation. It would be nice to annotate all their functions.

Event Timeline

vlorentz created this task.
vlorentz added a project: Easy hack.

Hi @vlorentz this will be my first contribution for Software Heritage so can you explain about the issue a little more. Also I am having some problems installing Arcanist (fatal error with php not getting resolved)into my system. Will it be possible to commit directly on github.

so can you explain about the issue a little more

The linked document should explain what type annotations are in Python; is there something you need help with?

Also I am having some problems installing Arcanist (fatal error with php not getting resolved)into my system.

Join the chat so we can try to help you

Will it be possible to commit directly on github.

No; we only have read-only mirrors on github, the actual development is here.

While annotating, are we expected to use native Python Datatypes (like str, int, float etc.) or do I use the NewType class of the Type library as in the example below:

from typing import NewType

UserId = NewType('UserId', int)
some_id = UserId(524313)