Skip to content

Commit 06ddc46

Browse files
committed
[API-Compat] Updated ForbidKeywordsDecorator
1 parent f589050 commit 06ddc46

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

python/paddle/utils/decorator_utils.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,16 +114,14 @@ def process(
114114

115115
return args, kwargs
116116

117-
class ForbidKeywordsDecorator(DecoratorBase[_P, _R]):
117+
class ForbidKeywordsDecorator(DecoratorBase):
118118
"""A decorator that hints users to use the correct `compat` functions, when erroneous keyword arguments are detected"""
119119

120120
def __init__(
121-
self, illegal_keys: list[str] | str, func_name: str, correct_name: str
121+
self, illegal_keys: list[str], func_name: str, correct_name: str
122122
) -> None:
123123
super().__init__()
124-
self.illegal_keys = (
125-
[illegal_keys] if isinstance(illegal_keys, str) else illegal_keys
126-
)
124+
self.illegal_keys = illegal_keys
127125
self.func_name = func_name
128126
self.correct_name = correct_name
129127

0 commit comments

Comments
 (0)