You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I misuse inheritance and I end up silencing mypy [override] warnings.
The only way I see to add type: ignore to the stub is to use a pattern file. It works fine, but to add a comment I have to put the full signature in the file. For example:
But if the function has overloads and one of the overloads is considered bad, mypy is silenced only by type: ignore in the first @overload line (even if it's the last overload that's guilty):
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Sometimes I misuse inheritance and I end up silencing mypy [override] warnings.
The only way I see to add
type: ignore
to the stub is to use a pattern file. It works fine, but to add a comment I have to put the full signature in the file. For example:For this, a hypothetical
\signature
substitution would be neat:But if the function has overloads and one of the overloads is considered bad, mypy is silenced only by
type: ignore
in the first@overload
line (even if it's the last overload that's guilty):I don't know what to propose, I'm just sharing this use case.
Beta Was this translation helpful? Give feedback.
All reactions