decimal.pyi: Add overload for Decimal.__round__() (#2674)

Fixes #2528
This commit is contained in:
Utkarsh Gupta
2018-12-07 14:30:24 +05:30
committed by Sebastian Rittau
parent 184148611a
commit b3ced5b8c0

View File

@@ -2,7 +2,7 @@ import numbers
import sys
from types import TracebackType
from typing import (
Any, Container, Dict, List, NamedTuple, Optional, Sequence, Text, Tuple, Type, TypeVar, Union,
Any, Container, Dict, List, NamedTuple, Optional, overload, Sequence, Text, Tuple, Type, TypeVar, Union,
)
_Decimal = Union[Decimal, int]
@@ -121,7 +121,12 @@ class Decimal(object):
def conjugate(self) -> Decimal: ...
def __complex__(self) -> complex: ...
if sys.version_info >= (3,):
def __round__(self, n: Optional[int] = ...) -> int: ...
@overload
def __round__(self) -> int: ...
@overload
def __round__(self, ndigits: None) -> int: ...
@overload
def __round__(self, ndigits: int) -> Decimal: ...
def __floor__(self) -> int: ...
def __ceil__(self) -> int: ...
else: