TYP: check_untyped_defs core.arrays.base #36885
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
xref #31160
from https://docs.python.org/3/library/functions.html?highlight=setattr#setattr
The changes here, don't 'fix' the issue. The correct solution is to create these methods with a statically defined interface, see #31160 (comment)
In the meantime, the changes here allows untyped defs in this module to be checked. (without adding type ignores)
pandas\core\arrays\base.py:1179: error: Unsupported left operand type for + ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1180: error: "Type[ExtensionOpsMixin]" has no attribute "radd" [attr-defined]
pandas\core\arrays\base.py:1181: error: Unsupported left operand type for - ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1182: error: "Type[ExtensionOpsMixin]" has no attribute "rsub" [attr-defined]
pandas\core\arrays\base.py:1183: error: Unsupported left operand type for * ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1184: error: "Type[ExtensionOpsMixin]" has no attribute "rmul" [attr-defined]
pandas\core\arrays\base.py:1185: error: Unsupported left operand type for ** ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1186: error: "Type[ExtensionOpsMixin]" has no attribute "rpow" [attr-defined]
pandas\core\arrays\base.py:1187: error: Unsupported left operand type for % ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1188: error: "Type[ExtensionOpsMixin]" has no attribute "rmod" [attr-defined]
pandas\core\arrays\base.py:1189: error: Unsupported left operand type for // ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1190: error: "Type[ExtensionOpsMixin]" has no attribute "rfloordiv" [attr-defined]
pandas\core\arrays\base.py:1191: error: Unsupported left operand type for / ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1192: error: "Type[ExtensionOpsMixin]" has no attribute "rtruediv" [attr-defined]
pandas\core\arrays\base.py:1193: error: Unsupported left operand type for divmod ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1194: error: "Type[ExtensionOpsMixin]" has no attribute "rdivmod" [attr-defined]
pandas\core\arrays\base.py:1202: error: Cannot assign to a method [assignment]
pandas\core\arrays\base.py:1203: error: Cannot assign to a method [assignment]
pandas\core\arrays\base.py:1204: error: Unsupported left operand type for < ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1205: error: Unsupported left operand type for > ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1206: error: Unsupported left operand type for <= ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1207: error: Unsupported left operand type for >= ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1215: error: Unsupported left operand type for & ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1216: error: "Type[ExtensionOpsMixin]" has no attribute "rand" [attr-defined]
pandas\core\arrays\base.py:1217: error: Unsupported left operand type for | ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1218: error: "Type[ExtensionOpsMixin]" has no attribute "ror" [attr-defined]
pandas\core\arrays\base.py:1219: error: Unsupported left operand type for ^ ("Type[ExtensionOpsMixin]") [operator]
pandas\core\arrays\base.py:1220: error: "Type[ExtensionOpsMixin]" has no attribute "rxor" [attr-defined]