mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-15 21:00:47 +00:00
Enable [unprefixed-type-param (PYI001)](https://docs.astral.sh/ruff/rules/unprefixed-type-param/#unprefixed-type-param-pyi001) Link: #110950 Pull Request resolved: https://github.com/pytorch/pytorch/pull/112823 Approved by: https://github.com/Skylion007
13 lines
310 B
Python
13 lines
310 B
Python
from typing import Optional, TypeVar, Type
|
|
|
|
_T = TypeVar('_T')
|
|
|
|
class Managed:
|
|
@classmethod
|
|
def current(cls: Type[_T], value: Optional[_T] = None, required: bool = True) -> _T: ...
|
|
|
|
def __call__(self, func: _T) -> _T: ...
|
|
|
|
def __enter__(self: _T) -> _T: ...
|
|
|
|
class DefaultManaged(Managed): ...
|