Code review comment for ~cjwatson/launchpad:ci-build-upload-make-spr

Revision history for this message
Colin Watson (cjwatson) wrote :

I really don't think namedtuples are suitable here because of the lack of support for optional items in their constructors.

For plain classes, how do you propose spelling them? This doesn't work for obvious reasons:

    class SourceArtifactMetadata:
        format # type: SourcePackageFileType
        name # type: str
        version # type: str

And if I use something like `format = None` there, then they all have to be `Optional[...]` when they really shouldn't be optional.

« Back to merge proposal