mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
[2/N] Simplify "in" operation for containers of a single item (#164323)
These issues are detected by ruff [FURB171](https://docs.astral.sh/ruff/rules/single-item-membership-test/#single-item-membership-test-furb171). Pull Request resolved: https://github.com/pytorch/pytorch/pull/164323 Approved by: https://github.com/justinchuby, https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
96c3b9e275
commit
cc8b14d09a
@ -3623,7 +3623,7 @@ class CheckFunctionManager:
|
||||
# Leave out the builtins dict key, as we will special handle
|
||||
# it later because the guarded code rarely use the entire
|
||||
# builtin dict in the common case.
|
||||
if name not in (builtins_dict_name,):
|
||||
if name != builtins_dict_name:
|
||||
used_global_vars.add(name)
|
||||
elif name := get_local_source_name(source):
|
||||
assert isinstance(name, str)
|
||||
|
||||
Reference in New Issue
Block a user