Skip to content

Commit 96322d3

Browse files
Superjomngovind-ramnarayan
authored andcommitted
[None][fix] the api_stability unify default values of None and inspect._empty (NVIDIA#8496)
Signed-off-by: Yan Chunwei <328693+Superjomn@users.noreply.github.com>
1 parent bf0a20f commit 96322d3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/unittest/api_stability/api_stability_core.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ class ParamSnapshot:
7979
default: Any = None
8080
status: Optional[str] = None
8181

82+
def __post_init__(self):
83+
# Unify default value of None and inspect._empty
84+
if self.default is inspect._empty:
85+
self.default = None
86+
8287
@classmethod
8388
def from_inspect(cls, param: inspect.Parameter):
8489
return cls(param.annotation, param.default)

0 commit comments

Comments
 (0)