Re: RFC: Enable type annotations and Mypy checks on Python projects in Fedora Infrastructure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2017-06-20 at 16:27 -0400, Randy Barlow wrote:
> Can mypy handle finding the types from docblocks, or is it strict
> about
> the format being like:
> 
> # type: (int, bool)
> 
> ?

To elaborate on my question, I've been doing docblocks in this style:

def add(x, y):
    """
    Return the sum of x and y.

    Args:
        x (int): The first number.
        y (int): The second number.
    Returns:
        int: The sum of x and y.
    """
    return x + y

It'd be suuuuuper nice if mypy could do that… ☺ If not, I guess I could
include both annotatations, or perhaps only the mypy annotation so that
I'm not adding duplicate info.

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
infrastructure mailing list -- infrastructure@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to infrastructure-leave@xxxxxxxxxxxxxxxxxxxxxxx

[Index of Archives]     [Fedora Development]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [KDE Users]

  Powered by Linux