Conversation
dlstadther
left a comment
There was a problem hiding this comment.
There are quite a number of type-ignores on here. Are they included because we you gave up trying to solve them? Or because the design of the parameter system (and typing) doesn't have a solution?
There still more value having a subset of typechecks than no type checks.
|
These OptionalParameterMixin uses super() calls whose MRO is only resolved at runtime. Mypy cannot statically determine the type of super() in this context, which causes misc/call-arg/arg-type errors. The same applies to the subclass definitions (OptionalIntParameter etc.) where mypy detects conflicting These are not "gave up" situations — they reflect the design of the existing mixin pattern, which Python's type system cannot fully express today. Resolving this properly would require reworking OptionalParameterMixin itself (e.g., replacing the mixin pattern with composition or a factory approach), which is out of scope for this PR. The suppressed errors are intentionally scoped to this mixin boundary. |
Description
Enable type checking for luigi/parameter.py.
Motivation and Context
Have you tested this? If so, how?