mirror of
https://github.com/vladmandic/automatic
synced 2026-09-19 17:24:32 +02:00
check for init and call
Signed-off-by: Vladimir Mandic <mandic00@live.com>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user