mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 05:24:52 +08:00
Use PEP 585 syntax in @python2/_ast, convert more TypeVars to _typeshed.Self, & # noqa a SQLAlchemy line (#6954)
* Manual fixes for `_ast` and `SQLAlchemy` * Change more `TypeVar`s to `Self`, using script
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
from _typeshed import Self
|
||||
from types import TracebackType
|
||||
from typing import Any, Container, NamedTuple, Sequence, Text, TypeVar, Union
|
||||
from typing import Any, Container, NamedTuple, Sequence, Text, Union
|
||||
|
||||
_Decimal = Union[Decimal, int]
|
||||
_DecimalNew = Union[Decimal, float, Text, tuple[int, Sequence[int], int]]
|
||||
_ComparableNum = Union[Decimal, float]
|
||||
_DecimalT = TypeVar("_DecimalT", bound=Decimal)
|
||||
|
||||
class DecimalTuple(NamedTuple):
|
||||
sign: int
|
||||
@@ -41,7 +41,7 @@ def getcontext() -> Context: ...
|
||||
def localcontext(ctx: Context | None = ...) -> _ContextManager: ...
|
||||
|
||||
class Decimal(object):
|
||||
def __new__(cls: type[_DecimalT], value: _DecimalNew = ..., context: Context | None = ...) -> _DecimalT: ...
|
||||
def __new__(cls: type[Self], value: _DecimalNew = ..., context: Context | None = ...) -> Self: ...
|
||||
@classmethod
|
||||
def from_float(cls, __f: float) -> Decimal: ...
|
||||
def __nonzero__(self) -> bool: ...
|
||||
|
||||
Reference in New Issue
Block a user