Skip to content

Commit e8381c1

Browse files
committed
fix review idea
Signed-off-by: Manjusaka <me@manjusaka.me>
1 parent 2a9333f commit e8381c1

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

Lib/functools.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -529,11 +529,8 @@ def _partial_annotate(partial_obj, format):
529529
import inspect
530530
from annotationlib import get_annotations
531531

532-
# Get the wrapped function
533-
func = partial_obj.func
534-
535532
# Get annotations from the wrapped function
536-
func_annotations = get_annotations(func, format=format)
533+
func_annotations = get_annotations(partial_obj.func, format=format)
537534

538535
if not func_annotations:
539536
return {}
@@ -577,11 +574,8 @@ def _partialmethod_annotate(partialmethod_obj, format):
577574
import inspect
578575
from annotationlib import get_annotations
579576

580-
# Get the wrapped function
581-
func = partialmethod_obj.func
582-
583577
# Get annotations from the wrapped function
584-
func_annotations = get_annotations(func, format=format)
578+
func_annotations = get_annotations(partialmethod_obj.func, format=format)
585579

586580
if not func_annotations:
587581
return {}
@@ -590,7 +584,7 @@ def _partialmethod_annotate(partialmethod_obj, format):
590584
# The first parameter (self/cls) should remain, but bound args should be removed
591585
try:
592586
# Get the function signature
593-
func_sig = inspect.signature(func, annotation_format=format)
587+
func_sig = inspect.signature(partialmethod_obj.func, annotation_format=format)
594588
func_params = list(func_sig.parameters.keys())
595589

596590
if not func_params:

0 commit comments

Comments
 (0)