mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Use _typeshed.Self in Python 2, too (#6932)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Self
|
||||
from abc import abstractmethod
|
||||
from typing import Pattern, Text, Tuple, TypeVar
|
||||
|
||||
@@ -8,7 +9,7 @@ class Version:
|
||||
@abstractmethod
|
||||
def __init__(self, vstring: Text | None = ...) -> None: ...
|
||||
@abstractmethod
|
||||
def parse(self: _T, vstring: Text) -> _T: ...
|
||||
def parse(self: Self, vstring: Text) -> Self: ...
|
||||
@abstractmethod
|
||||
def __str__(self) -> str: ...
|
||||
@abstractmethod
|
||||
@@ -19,7 +20,7 @@ class StrictVersion(Version):
|
||||
version: Tuple[int, int, int]
|
||||
prerelease: Tuple[Text, int] | None
|
||||
def __init__(self, vstring: Text | None = ...) -> None: ...
|
||||
def parse(self: _T, vstring: Text) -> _T: ...
|
||||
def parse(self: Self, vstring: Text) -> Self: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __cmp__(self: _T, other: _T | str) -> bool: ...
|
||||
|
||||
@@ -28,6 +29,6 @@ class LooseVersion(Version):
|
||||
vstring: Text
|
||||
version: Tuple[Text | int, ...]
|
||||
def __init__(self, vstring: Text | None = ...) -> None: ...
|
||||
def parse(self: _T, vstring: Text) -> _T: ...
|
||||
def parse(self: Self, vstring: Text) -> Self: ...
|
||||
def __str__(self) -> str: ...
|
||||
def __cmp__(self: _T, other: _T | str) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user