mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 21:01:52 +08:00
Accept Text in distutils *Version classes (#1854)
This commit is contained in:
committed by
Jelle Zijlstra
parent
b111a4537f
commit
fa98de6d57
@@ -1,6 +1,6 @@
|
||||
import sys
|
||||
from abc import abstractmethod
|
||||
from typing import Any, Optional, TypeVar, Union, Pattern, Tuple
|
||||
from typing import Any, Optional, TypeVar, Union, Pattern, Text, Tuple
|
||||
|
||||
_T = TypeVar('_T', bound='Version')
|
||||
|
||||
@@ -15,9 +15,9 @@ class Version:
|
||||
def __ge__(self: _T, other: Union[_T, str]) -> bool: ...
|
||||
|
||||
@abstractmethod
|
||||
def __init__(self, vstring: Optional[str] = ...) -> None: ...
|
||||
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
|
||||
@abstractmethod
|
||||
def parse(self: _T, vstring: str) -> _T: ...
|
||||
def parse(self: _T, vstring: Text) -> _T: ...
|
||||
@abstractmethod
|
||||
def __str__(self) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
@@ -30,10 +30,10 @@ class Version:
|
||||
class StrictVersion(Version):
|
||||
version_re: Pattern[str]
|
||||
version: Tuple[int, int, int]
|
||||
prerelease: Optional[Tuple[str, int]]
|
||||
prerelease: Optional[Tuple[Text, int]]
|
||||
|
||||
def __init__(self, vstring: Optional[str] = ...) -> None: ...
|
||||
def parse(self: _T, vstring: str) -> _T: ...
|
||||
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
|
||||
def parse(self: _T, vstring: Text) -> _T: ...
|
||||
def __str__(self) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
def _cmp(self: _T, other: Union[_T, str]) -> bool: ...
|
||||
@@ -42,11 +42,11 @@ class StrictVersion(Version):
|
||||
|
||||
class LooseVersion(Version):
|
||||
component_re: Pattern[str]
|
||||
vstring: str
|
||||
version: Tuple[Union[str, int], ...]
|
||||
vstring: Text
|
||||
version: Tuple[Union[Text, int], ...]
|
||||
|
||||
def __init__(self, vstring: Optional[str] = ...) -> None: ...
|
||||
def parse(self: _T, vstring: str) -> _T: ...
|
||||
def __init__(self, vstring: Optional[Text] = ...) -> None: ...
|
||||
def parse(self: _T, vstring: Text) -> _T: ...
|
||||
def __str__(self) -> str: ...
|
||||
if sys.version_info >= (3,):
|
||||
def _cmp(self: _T, other: Union[_T, str]) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user