[BE] Enable Ruff's Flake8 PYI034 (#111105)

Enable [non-self-return-type (PYI034)](https://docs.astral.sh/ruff/rules/non-self-return-type/#non-self-return-type-pyi034)

Link: #110950

**EDIT**: to newly added reviewers, please ignore the request, it's due to a rebase error 😅

Pull Request resolved: https://github.com/pytorch/pytorch/pull/111105
Approved by: https://github.com/Skylion007
This commit is contained in:
isdanni
2023-10-13 21:19:50 +00:00
committed by PyTorch MergeBot
parent 2fd546aa5e
commit 382327bd0e
4 changed files with 14 additions and 10 deletions

View File

@ -26,6 +26,8 @@ from typing import (
Union,
)
from typing_extensions import Self
from torchgen.code_template import CodeTemplate
@ -486,7 +488,7 @@ class OrderedSet(Generic[T]):
def __or__(self, other: "OrderedSet[T]") -> "OrderedSet[T]":
return OrderedSet.union(self, other)
def __ior__(self, other: "OrderedSet[T]") -> "OrderedSet[T]":
def __ior__(self, other: "OrderedSet[T]") -> Self:
self.update(other)
return self