Skip to content

Commit

Permalink
Merged in refactor/warnings_type_inspection (pull request #472)
Browse files Browse the repository at this point in the history
fix type inspection

Approved-by: Randy Taylor
  • Loading branch information
jrkerns committed Nov 7, 2024
2 parents c960e71 + af9c279 commit 647cad7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pylinac/core/warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
import warnings
from functools import wraps
from threading import Lock
from typing import Any, TypeVar

T = TypeVar("T", bound=type[Any]) # Class type


class WarningCollectorMixin:
Expand Down Expand Up @@ -67,7 +70,7 @@ def wrapper(self, *args, **kwargs):
return wrapper


def capture_warnings(cls):
def capture_warnings(cls: type[T]) -> type[T]:
"""
Class decorator to automatically apply the capture_warnings decorator
to all methods of the class that are not private or special methods.
Expand Down

0 comments on commit 647cad7

Please sign in to comment.