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
Forgetting to call a method, i.e. missing (), is a somewhat common programming error. Mypy will typically catch this error, but often error messages includes something like "Callable[...]" has no attribute "foo". Since the callable type may be pretty complicated, this can look confusing.
Here are a few ideas that could make this better:
Only say Callable object has no attribute "foo" (omit the full callable type).
Add a note such as Did you mean ".foo()" (with parentheses)? (needs wordsmithing).
In addition to (1), show the signature of the function in a separate note pretty-printed using function definition syntax such as def foo() -> List[X].
The text was updated successfully, but these errors were encountered:
Forgetting to call a method, i.e. missing
()
, is a somewhat common programming error. Mypy will typically catch this error, but often error messages includes something like"Callable[...]" has no attribute "foo"
. Since the callable type may be pretty complicated, this can look confusing.Here are a few ideas that could make this better:
Callable object has no attribute "foo"
(omit the full callable type).Did you mean ".foo()" (with parentheses)?
(needs wordsmithing).def foo() -> List[X]
.The text was updated successfully, but these errors were encountered: