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 }}
Repository navigation
Support type information from conditional expressions #806
I think adding this kind of logic with if callable(x): has come up before in this issue tracker. It should be easy to do (with the provision that mypy currently only understands that Callable things are callable, but not in general instances with __call__ methods; but that should be sufficient in your example).
Yeah, adding callable() is #1973. Better support for __call__ is #797.
On Fri, Oct 14, 2016 at 5:53 AM, Reid Barton [email protected]
wrote:
I think adding this kind of logic with if callable(x): has come up before
in this issue tracker. It should be easy to do (with the provision that
mypy currently only understands that Callable things are callable, but
not in general instances with call methods; but that should be
sufficient in your example).
Activity
sametmax commentedon Oct 14, 2016
If there the same fix with
if callable()? Because I got this:And mypy complains that
indexmay not have astartattribute.rwbarton commentedon Oct 14, 2016
I think adding this kind of logic with
if callable(x):has come up before in this issue tracker. It should be easy to do (with the provision that mypy currently only understands thatCallablethings are callable, but not in general instances with__call__methods; but that should be sufficient in your example).gvanrossum commentedon Oct 14, 2016
Yeah, adding callable() is #1973. Better support for
__call__is #797.On Fri, Oct 14, 2016 at 5:53 AM, Reid Barton [email protected]
wrote:
--Guido van Rossum (python.org/~guido)