[BE]: Enable a PLC0131, PLC0132, PLC0205. Fix PLC0132 bug. (#115015)

Enable pylint rules `PLC0131` and `PLC0132`. There was a violation of the `PLC0132` so this commit also fixes it and enables the rules so the violation do not occur again. `PLC0205` checks accidentally setting your `__slots__` to a string which is almost always a bug.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/115015
Approved by: https://github.com/jansel, https://github.com/malfet
This commit is contained in:
Aaron Gokaslan
2023-12-02 20:35:08 +00:00
committed by PyTorch MergeBot
parent 13410d0eda
commit d7b303dcf8
2 changed files with 4 additions and 1 deletions

View File

@ -85,6 +85,9 @@ select = [
"PIE804",
"PIE807",
"PIE810",
"PLC0131", # type bivariance
"PLC0132", # type param mismatch
"PLC0205", # string as __slots__
"PLE",
"PLR0133", # constant comparison
"PLR0206", # property with params

View File

@ -17,7 +17,7 @@ ArrayLikeOrScalar = typing.Union[ArrayLike, Scalar]
DTypeLike = typing.TypeVar("DTypeLike")
AxisLike = typing.TypeVar("AxisLike")
NDArray = typing.TypeVar("NDarray")
NDArray = typing.TypeVar("NDArray")
CastingModes = typing.TypeVar("CastingModes")
KeepDims = typing.TypeVar("KeepDims")