mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-11-01 17:22:17 +08:00
Allow math.trunc to only accept __trunc__-supporting objects (#6003)
Add SupportsTrunc protocol
This commit is contained in:
1 parent
3819f8e6ff
commit
d599a535b2
2 files changed
+5
-1
No files matched your search
@@ -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