mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-18 18:05:57 +08:00
Use _typeshed.Self in Python 2, too (#6932)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import Self
|
||||
from abc import ABCMeta
|
||||
from typing import Any, Dict, Iterator, List, Mapping, Type, TypeVar, Union
|
||||
|
||||
@@ -59,15 +60,15 @@ class Flag(Enum):
|
||||
def __repr__(self) -> str: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __or__(self: _T, other: _T) -> _T: ...
|
||||
def __and__(self: _T, other: _T) -> _T: ...
|
||||
def __xor__(self: _T, other: _T) -> _T: ...
|
||||
def __invert__(self: _T) -> _T: ...
|
||||
def __or__(self: Self, other: Self) -> Self: ...
|
||||
def __and__(self: Self, other: Self) -> Self: ...
|
||||
def __xor__(self: Self, other: Self) -> Self: ...
|
||||
def __invert__(self: Self) -> Self: ...
|
||||
|
||||
class IntFlag(int, Flag):
|
||||
def __or__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
def __and__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
def __xor__(self: _T, other: Union[int, _T]) -> _T: ...
|
||||
def __or__(self: Self, other: Union[int, Self]) -> Self: ...
|
||||
def __and__(self: Self, other: Union[int, Self]) -> Self: ...
|
||||
def __xor__(self: Self, other: Union[int, Self]) -> Self: ...
|
||||
__ror__ = __or__
|
||||
__rand__ = __and__
|
||||
__rxor__ = __xor__
|
||||
|
||||
Reference in New Issue
Block a user