Mypy question: I have the following code: ``` ...
# general
r
Mypy question: I have the following code:
Copy code
if isinstance(current_target, JvmTarget):
            # Some code...
            if isinstance(current_target, RuntimePlatformMixin):
                info["runtime_platform"] = current_target.runtime_platform.name
In CI, mypy complains that:
Copy code
src/python/pants/backend/project_info/tasks/export_dep_as_jar.py: note: In member "_process_target" of class "ExportDepAsJar":
src/python/pants/backend/project_info/tasks/export_dep_as_jar.py:319:17: error:
Statement is unreachable  [misc]
                    info["runtime_platform"] = current_target.runtime_plat...
                    ^
Which is apparently a thing in the presence of multiple inheritance https://github.com/python/mypy/issues/3603 Is it okay to skip typechecking in this line, with a reference to the issue (or one of the follow ups, since that one is closed)? cc\ @hundreds-father-404
h
yes, that is okay to skip :)
please do link to the issue + use the error code in your skip, e.g.
# type: ignore[call-args]
r
Thanks!
In the error above, the code is
[misc]
, right?
h
correct
r
Done, thanks a lot!
❤️ 1