mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Add SupportsRichComparison type to _typeshed (#6583)
Use it to improve types of `max()` and other functions. Also make some other tweaks to types related to comparison dunders. Fixes #6575
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from _typeshed import SupportsLessThanT
|
||||
from _typeshed import SupportsRichComparisonT
|
||||
from decimal import Decimal
|
||||
from fractions import Fraction
|
||||
from typing import Any, Hashable, Iterable, NamedTuple, Sequence, SupportsFloat, Type, TypeVar, Union
|
||||
@@ -27,8 +27,8 @@ else:
|
||||
def harmonic_mean(data: Iterable[_NumberT]) -> _NumberT: ...
|
||||
|
||||
def median(data: Iterable[_NumberT]) -> _NumberT: ...
|
||||
def median_low(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ...
|
||||
def median_high(data: Iterable[SupportsLessThanT]) -> SupportsLessThanT: ...
|
||||
def median_low(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ...
|
||||
def median_high(data: Iterable[SupportsRichComparisonT]) -> SupportsRichComparisonT: ...
|
||||
def median_grouped(data: Iterable[_NumberT], interval: _NumberT = ...) -> _NumberT: ...
|
||||
def mode(data: Iterable[_HashableT]) -> _HashableT: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user