mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-01-25 12:26:44 +08:00
Allow math.trunc to only accept __trunc__-supporting objects (#6003)
Add SupportsTrunc protocol
This commit is contained in:
@@ -41,6 +41,9 @@ class SupportsLenAndGetItem(Protocol[_T_co]):
|
||||
def __len__(self) -> int: ...
|
||||
def __getitem__(self, __k: int) -> _T_co: ...
|
||||
|
||||
class SupportsTrunc(Protocol):
|
||||
def __trunc__(self) -> int: ...
|
||||
|
||||
# Mapping-like protocols
|
||||
|
||||
# stable
|
||||
|
||||
Reference in New Issue
Block a user