• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pomponchik / transfunctions / 21871189384

10 Feb 2026 03:28PM UTC coverage: 98.447% (+0.1%) from 98.339%
21871189384

Pull #10

github

Евгений Блинов
Add overload definitions for transfunction decorator
Pull Request #10: 0.0.9

74 of 77 new or added lines in 7 files covered. (96.1%)

317 of 322 relevant lines covered (98.45%)

7.83 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

93.75
/transfunctions/decorators/transfunction.py
1
from inspect import currentframe
8✔
2
from types import FrameType
8✔
3
from typing import Union, cast, overload
8✔
4

5
from transfunctions.transformer import FunctionTransformer
8✔
6
from transfunctions.typing import Callable, FunctionParams, ReturnType
8✔
7

8

9
@overload
8✔
10
def transfunction(function: Callable[FunctionParams, ReturnType]) -> FunctionTransformer[FunctionParams, ReturnType]: ...
8✔
11

12

13
@overload
8✔
14
def transfunction(
8✔
15
    *, check_decorators: bool = True,
16
) -> Callable[[Callable[FunctionParams, ReturnType]], FunctionTransformer[FunctionParams, ReturnType]]: ...
17

18

19
def transfunction(  # type: ignore[misc]
8✔
20
    *args: Callable[FunctionParams, ReturnType], check_decorators: bool = True,
21
) -> Union[Callable[[Callable[FunctionParams, ReturnType]], FunctionTransformer[FunctionParams, ReturnType]], FunctionTransformer[FunctionParams, ReturnType]]:
22
    frame = currentframe()
8✔
23

24
    def decorator(
8✔
25
        function: Callable[FunctionParams, ReturnType],
26
    ) -> FunctionTransformer[FunctionParams, ReturnType]:
27
        return FunctionTransformer(
8✔
28
            function,
29
            cast(FrameType, cast(FrameType, frame).f_back).f_lineno,
30
            "transfunction",
31
            cast(FrameType, cast(FrameType, frame).f_back),
32
            check_decorators,
33
        )
34

35
    if args:
8✔
36
        return decorator(args[0])
8✔
37

NEW
38
    return decorator
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc