From b0af5a66cdae1d09f5ec512de2c59d64a754b204 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 24 Dec 2025 12:50:16 +0000 Subject: [PATCH] Add type annotations to helper functions per code review - Added type annotations to strict_types decorator (func: F -> F) - Added type annotations to _check_type parameters (value: Any, expected_type: Type) - Removed unused get_type_hints import - Added TypeVar and proper typing imports for decorator - All functions now have complete type annotations including helpers Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com> --- Programs/_freeze_module.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Programs/_freeze_module.py b/Programs/_freeze_module.py index 954aea7..90146b7 100644 --- a/Programs/_freeze_module.py +++ b/Programs/_freeze_module.py @@ -16,12 +16,14 @@ All function parameters must have type annotations. import inspect import marshal import sys -from typing import TextIO, get_type_hints +from typing import Any, Callable, TextIO, Type, TypeVar header: str = "/* Auto-generated by Programs/_freeze_module.py */" +F = TypeVar('F', bound=Callable[..., Any]) -def strict_types(func): + +def strict_types(func: F) -> F: """Decorator that enforces type annotations on all parameters. Raises: @@ -46,7 +48,7 @@ def strict_types(func): return func -def _check_type(value, expected_type, param_name: str) -> None: +def _check_type(value: Any, expected_type: Type, param_name: str) -> None: """Enforce strict type checking at runtime. Args: