check for init and call

Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
Vladimir Mandic
2025-04-03 19:23:33 -04:00
parent 8725cfc488
commit ea0389162f
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -19,12 +19,14 @@ class NoWatermark:
def get_signature(cls):
if cls is None or not hasattr(cls, '__init__'):
return {}
signature = inspect.signature(cls.__init__, follow_wrapped=True)
return signature.parameters
def get_call(cls):
if cls is None:
if cls is None or not hasattr(cls, '__call__'): # noqa: B004
return []
signature = inspect.signature(cls.__call__, follow_wrapped=True)
return signature.parameters