mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-21 05:34:18 +08:00
[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:
committed by
PyTorch MergeBot
parent
2fd546aa5e
commit
382327bd0e
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user