You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
defcheck_return_type(def_docstring, context, is_script):
"""PEP257 Return value type should be mentioned. However, the nature of the return value cannot be determined by introspection, so it should be mentioned. """if (notdef_docstring) oris_script:
returnif'return'notindef_docstring.lower():
tokens=list(tk.generate_tokens(StringIO(context).readline))
after_return= [tokens[i+1][0] fori, tokeninenumerate(tokens)
iftoken[1] =='return']
# not very precise (tk.OP ';' is not taken into account)ifset(after_return) -set([tk.COMMENT, tk.NL, tk.NEWLINE]) !=set([]):
return"PEP257 Return value type should be mentioned.",
As you can see it checks if there is a 'return' token in the body of function. In order to solve this bug the function should skip nested functions...
I will try to fix this when I have time, otherwise you're welcome to submit a patch.
If I check
I will get the warning
even though
a()
does not return anything.The text was updated successfully, but these errors were encountered: