Coverage for mlos_bench/mlos_bench/services/types/bound_method.py: 75%

8 statements  

« prev     ^ index     » next       coverage.py v7.6.10, created at 2025-01-21 01:50 +0000

1# 

2# Copyright (c) Microsoft Corporation. 

3# Licensed under the MIT License. 

4# 

5"""Protocol representing a bound method.""" 

6 

7from typing import Any, Protocol, runtime_checkable 

8 

9 

10@runtime_checkable 

11class BoundMethod(Protocol): 

12 """A callable method bound to an object.""" 

13 

14 # pylint: disable=too-few-public-methods 

15 # pylint: disable=unnecessary-ellipsis 

16 

17 @property 

18 def __self__(self) -> Any: 

19 """The self object of the bound method.""" 

20 ... 

21 

22 def __call__(self, *args: Any, **kwargs: Any) -> Any: 

23 """Call the bound method.""" 

24 ...