Software Alternatives & Reviews

Python is two languages now, and that's great

asdf-vm Pyright
  1. An extendable version manager
    Pricing:
    • Open Source

    #Programming #Programming Tools #Version Manager 163 social mentions

  2. Static type checker for Python. Contribute to microsoft/pyright development by creating an account on GitHub.
    I've had lots of success using pyright [1] for Python projects, it has sensible defaults and can be configured with a pyproject.toml file so everyone's using the same settings. I use the Pylance VSCode extension to catch errors earlier, but I also put it in pre-commit and as a CI check, so all contributors are committing the same quality of typed code. With more complex types, I've found it isn't necessary to do anything more complex than specifying the element type of a list or dict most of the time. I have typehinted lambda function arguments before, but just using the plain Callable typehint is usually enough. When I forget if I need to use an Iterator or an Iterable (which is every time), then I just try one and run the type checker and change it to the other if I guessed incorrectly. Type checking Python can become complex if you expect to be able to express everything in the typehints, but Python's type system isn't powerful enough for that. I feel its strength is that it lets you add as much detail to the types as is convenient. [1] <a href="https://github.com/microsoft/pyright">https://github.com/microsoft/pyright</a>.

    #Code Coverage #Code Analysis #Code Quality 13 social mentions

Discuss: Python is two languages now, and that's great

Log in or Post with