mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Enable ruff rule E721 (#165162)
`E721` checks for object type comparisons using == and other comparison operators. This is useful because it is recommended to use `is` for type comparisons. Pull Request resolved: https://github.com/pytorch/pytorch/pull/165162 Approved by: https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
a33f85e791
commit
8de85896e0
@ -554,7 +554,7 @@ def fuzz_scalar(spec, seed: Optional[int] = None) -> Union[float, int, bool, com
|
||||
|
||||
def specs_compatible(spec1: Spec, spec2: Spec) -> bool:
|
||||
"""Check if two specifications are compatible (one can be used where the other is expected)."""
|
||||
if type(spec1) != type(spec2):
|
||||
if type(spec1) is not type(spec2):
|
||||
return False
|
||||
|
||||
if isinstance(spec1, ScalarSpec):
|
||||
|
Reference in New Issue
Block a user