Skip to content

Commit a485b91

Browse files
authored
Update src/makefun/main.py
1 parent 4f5c5ca commit a485b91

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/makefun/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ def create_function(func_signature, # type: Union[str, Signature]
246246
if isinstance(func_signature, str):
247247
# transform the string into a Signature and make sure the string contains ":"
248248
func_name_from_str, func_signature, func_signature_str = get_signature_from_string(func_signature, evaldict)
249+
# If the signature is specified as a string, `__signature__` will not be correct in this case, since it
250+
# will be a string. If it was computed in some other fashion (i.e. is an instance of inspect.Signature),
251+
# then there is no need to update it.
249252
if '__signature__' in attrs:
250253
attrs['__signature__'] = func_signature
251254

0 commit comments

Comments
 (0)