ML
    • Register
    • Login
    • Search
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Check out MyPy for Improving Your Python Project

    Developer Discussion
    python mypy fedora magazine
    1
    1
    467
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mlnews
      mlnews last edited by

      Fedora Magazine this month talks about the mypy utility. MyPy is a static type checker for Python.

      According to MyPy:

      Migrate existing code to static typing, a function at a time. You can freely mix static and dynamic typing within a program, within a module or within an expression. No need to give up dynamic typing — use static typing when it makes sense. Often just adding function signatures gives you statically typed code. Mypy can infer the types of other variables.
      Python syntax

      Mypy type checks programs that have type annotations conforming to PEP 484. Getting started is easy if you know Python. The aim is to support almost all Python language constructs in mypy.
      Powerful type system

      Mypy has a powerful, modern type system with features such as bidirectional type inference, generics, callable types, abstract base classes, multiple inheritance and tuple types.
      Access to Python libs

      Many commonly used libraries have stubs (statically typed interface definitions) that allow mypy to check that your code uses the libraries correctly.

      1 Reply Last reply Reply Quote 1
      • First post
        Last post