tmt icon indicating copy to clipboard operation
tmt copied to clipboard

Switch metaclass to `__init_subclass__` ?

Open LecrisUT opened this issue 7 months ago • 2 comments

I am mostly considering the comment

        # TODO: repeat type annotation from `Common` - IIUIC, `cls` should be
        # the class being created, in our case that would be a subclass of
        # `Common`. For some reason, mypy is uncapable of detecting annotation
        # of this attribute in `Common`, and infers its type is `None` because
        # of the assignment below. That's incomplete, and leads to mypy warning
        # about assignments of `CliInvocation` instances to this attribute.
        # Repeating the annotation silences mypy, giving it better picture.

But not sure I quite understand what is meant with the comment.

LecrisUT avatar Jun 28 '24 23:06 LecrisUT