[code-quality] Catching multiple return types

Skip Montanaro skip.montanaro at gmail.com
Wed Apr 18 18:08:53 EDT 2018


Thanks, good to know. Yet another tool for the kit...

S

On Wed, Apr 18, 2018, 3:43 PM Dan Stromberg <strombrg at gmail.com> wrote:

>
> IINM, mypy can catch such things.  But that's a different sort of tool of
> course.
>
> On Wed, Apr 18, 2018 at 1:25 PM, Skip Montanaro <skip.montanaro at gmail.com>
> wrote:
>
>> Is there a static checker which will catch multiple return types?
>> Consider this dumb example:
>>
>> def func(a, b, c):
>>     if c:
>>         return (a, b)
>>     return 0
>>
>> I thought pylint had a checker for that, but running with
>> --rcfile=/dev/null didn't complain about the different types being
>> returned. Is there perhaps a checker for that which isn't enabled by
>> default? Or another static tool which will catch it?
>>
>> Thx,
>>
>> Skip
>> _______________________________________________
>> code-quality mailing list
>> code-quality at python.org
>> https://mail.python.org/mailman/listinfo/code-quality
>>
>
>
>
> --
> Dan Stromberg
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/code-quality/attachments/20180418/125f27bb/attachment.html>


More information about the code-quality mailing list